]> granicus.if.org Git - postgresql/commitdiff
Free libpgeasy result structure on database close; fixed memory leak.
authorBruce Momjian <bruce@momjian.us>
Thu, 13 Dec 2001 09:40:18 +0000 (09:40 +0000)
committerBruce Momjian <bruce@momjian.us>
Thu, 13 Dec 2001 09:40:18 +0000 (09:40 +0000)
src/interfaces/libpgeasy/libpgeasy.c

index 0f049d6262d546a3b0e33eed4fdd68d756f2487f..b1d1104f3b0f964d71a6fce057d989eaec735a39 100644 (file)
@@ -62,6 +62,11 @@ connectdb(char *options)
 void
 disconnectdb()
 {
+       if (res != NULL &&
+               in_result_block == FALSE &&
+               was_get_unset_result == FALSE)
+               PQclear(res);
+
        PQfinish(conn);
 }