[postgis-devel] [postgis-tickets] r15723 - #3847, coverity fixes in topology and address standardizer

Paul Ramsey pramsey at cleverelephant.ca
Thu Sep 14 07:40:55 PDT 2017


Probably you aren't missing anything, I only tested that things built and
regressed.

On Thu, Sep 14, 2017 at 7:19 AM, Sandro Santilli <strk at kbt.io> wrote:

> On Thu, Sep 14, 2017 at 06:56:57AM -0700, Paul Ramsey wrote:
> > Author: pramsey
> > Date: 2017-09-14 06:56:57 -0700 (Thu, 14 Sep 2017)
> > New Revision: 15723
> >
> > Modified:
> >    trunk/extensions/address_standardizer/gamma.c
> >    trunk/topology/postgis_topology.c
> > Log:
> > #3847, coverity fixes in topology and address standardizer
> >
>
> The change below seems to be calling SPI_prepare on each and every
> call (previously it was only called on first invocation).
>
> > Modified: trunk/topology/postgis_topology.c
> > ===================================================================
> > --- trunk/topology/postgis_topology.c 2017-09-14 13:52:25 UTC (rev
> 15722)
> > +++ trunk/topology/postgis_topology.c 2017-09-14 13:56:57 UTC (rev
> 15723)
> > @@ -170,21 +170,19 @@
> >    static SPIPlanPtr plan = NULL;
> >
> >    // prepare
> > -  if ( ! plan ) {
> > -    sql = "SELECT id,srid,precision,null::geometry"
> > -                          " FROM topology.topology "
> > -                          "WHERE name = $1::varchar";
> > -    argtypes[0] = CSTRINGOID;
> > -    plan = SPI_prepare(sql, 1, argtypes);
> > -    if ( ! plan )
> > -    {
> > -      cberror(be, "unexpected return (%d) from query preparation: %s",
> > -              SPI_result, sql);
> > -      return NULL;
> > -    }
> > -    SPI_keepplan(plan);
> > -    // SPI_freeplan to free, eventually
> > +  sql = "SELECT id,srid,precision,null::geometry"
> > +                        " FROM topology.topology "
> > +                        "WHERE name = $1::varchar";
> > +  argtypes[0] = CSTRINGOID;
> > +  plan = SPI_prepare(sql, 1, argtypes);
> > +  if ( ! plan )
> > +  {
> > +    cberror(be, "unexpected return (%d) from query preparation: %s",
> > +            SPI_result, sql);
> > +    return NULL;
> >    }
> > +  SPI_keepplan(plan);
> > +  // SPI_freeplan to free, eventually
> >
>
> Or am I missing anything ?
>
> --strk;
>
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20170914/4f962541/attachment.html>


More information about the postgis-devel mailing list