]> granicus.if.org Git - php/commitdiff
Prevent double free.
authorIlia Alshanetsky <iliaa@php.net>
Tue, 3 May 2005 22:50:00 +0000 (22:50 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 3 May 2005 22:50:00 +0000 (22:50 +0000)
ext/pgsql/pgsql.c

index bbcbd2362ccfdf138fc5c34b558ae75789e6c09e..1d63ec264d1539b57814ac3556be898ada1caebb 100644 (file)
@@ -356,8 +356,11 @@ static void _php_pgsql_notice_handler(void *resource_id, const char *message)
 static void _php_pgsql_notice_ptr_dtor(void **ptr) 
 {
        php_pgsql_notice *notice = (php_pgsql_notice *)*ptr;
-       efree(notice->message);
-       efree(notice);
+       if (notice) {
+               efree(notice->message);
+               efree(notice);
+               notice = NULL;
+       }
 }
 /* }}} */