]> granicus.if.org Git - php/commitdiff
fixed problems in mysql_stmt_init (missing alloc from stmt)
authorGeorg Richter <georg@php.net>
Thu, 18 Mar 2004 13:04:55 +0000 (13:04 +0000)
committerGeorg Richter <georg@php.net>
Thu, 18 Mar 2004 13:04:55 +0000 (13:04 +0000)
ext/mysqli/mysqli_api.c

index d3ad49837ab2cb6774d6815daf5dc86cbf11e7f3..0927df66d7021405e9422d8e2dfa415c74bb336f 100644 (file)
@@ -1675,7 +1675,10 @@ PHP_FUNCTION(mysqli_stmt_init)
        }
        MYSQLI_FETCH_RESOURCE(mysql, MYSQL *, &mysql_link, "mysqli_link");
 
+       stmt = (STMT *)ecalloc(1,sizeof(STMT));
+
        if (!(stmt->stmt = mysql_stmt_init(mysql))) {
+               efree(stmt);
                RETURN_FALSE;
        }