Fix minor leak in pg_dump for ACCESS METHOD.
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 28 Mar 2016 17:27:41 +0000 (14:27 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 28 Mar 2016 17:27:41 +0000 (14:27 -0300)
Bug reported by Coverity.

Author: Michaël Paquier

src/bin/pg_dump/pg_dump.c

index 77bf8acd9fb37e28ad88af29048fc8b91ce73f57..077b37eb43dbedce1d2ecf0bec390f57880685db 100644 (file)
@@ -11580,6 +11580,7 @@ dumpAccessMethod(Archive *fout, AccessMethodInfo *aminfo)
                default:
                        write_msg(NULL, "WARNING: invalid type %c of access method %s\n",
                                          aminfo->amtype, qamname);
+                       pg_free(qamname);
                        destroyPQExpBuffer(q);
                        destroyPQExpBuffer(delq);
                        destroyPQExpBuffer(labelq);
@@ -11609,7 +11610,7 @@ dumpAccessMethod(Archive *fout, AccessMethodInfo *aminfo)
                                NULL, "",
                                aminfo->dobj.catId, 0, aminfo->dobj.dumpId);
 
-       free(qamname);
+       pg_free(qamname);
 
        destroyPQExpBuffer(q);
        destroyPQExpBuffer(delq);