]> granicus.if.org Git - python/commitdiff
Coverity issue CID #167
authorChristian Heimes <christian@cheimes.de>
Fri, 18 Jan 2008 07:45:30 +0000 (07:45 +0000)
committerChristian Heimes <christian@cheimes.de>
Fri, 18 Jan 2008 07:45:30 +0000 (07:45 +0000)
Event alloc_fn: Called allocation function "metacompile" [model]
Event var_assign: Assigned variable "gr" to storage returned from "metacompile"
gr = metacompile(n);
Event pass_arg: Variable "gr" not freed or pointed-to in function "maketables" [model]
g = maketables(gr);
   translatelabels(g);
   addfirstsets(g);
Event leaked_storage: Returned without freeing storage "gr"
return g;

Parser/pgen.c

index 76cb204751ed5715bb12e68c97190acaa8121256..959a5d3443f95398e3cecd223587f00bf0783c7d 100644 (file)
@@ -667,6 +667,7 @@ pgen(node *n)
        g = maketables(gr);
        translatelabels(g);
        addfirstsets(g);
+       PyObject_FREE(gr);
        return g;
 }