]> granicus.if.org Git - php/commitdiff
MFH: fix leak in php_local_infile_init() handler
authorAntony Dovgal <tony2001@php.net>
Thu, 27 Jul 2006 10:53:15 +0000 (10:53 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 27 Jul 2006 10:53:15 +0000 (10:53 +0000)
ext/mysqli/mysqli.c

index 65300d86820a167de74c3fbc0cf8db672f3fd9df..68368962a986a2425e46436079bae5462c78f5b2 100644 (file)
@@ -1149,11 +1149,15 @@ void php_local_infile_end(void *ptr)
 
        data= (mysqli_local_infile *)ptr;
 
-       if (!(mysql = data->userdata)) {
+       if (!data || !(mysql = data->userdata)) {
+               if (data) {
+                       free(data);
+               }
                return;
        }
 
        php_stream_close(mysql->li_stream);
+       free(data);
        return; 
 }
 /* }}} */