From: Ilia Alshanetsky Date: Tue, 3 May 2005 22:50:00 +0000 (+0000) Subject: Prevent double free. X-Git-Tag: php-5.0.1b1~332 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bdbce01588f326798844b25cf059596b44db119c;p=php Prevent double free. --- diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index bbcbd2362c..1d63ec264d 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -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; + } } /* }}} */