]> granicus.if.org Git - php/commitdiff
fixed mem leak in constructor
authorGeorg Richter <georg@php.net>
Sun, 23 Nov 2003 07:50:04 +0000 (07:50 +0000)
committerGeorg Richter <georg@php.net>
Sun, 23 Nov 2003 07:50:04 +0000 (07:50 +0000)
ext/mysqli/mysqli_nonapi.c

index ed09af20e565a8831afd5b51817d2d6e890d5933..44d7e5011f8e8cdc7c907e2c64770ce49c03344b 100644 (file)
@@ -42,6 +42,10 @@ PHP_FUNCTION(mysqli_connect)
        unsigned int            port=0;
        struct timeval          starttime;
 
+       if (getThis() && !ZEND_NUM_ARGS()) {
+               RETURN_NULL();
+       }
+
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ssssls", &hostname, &hostname_len, &username, &username_len, 
                &passwd, &passwd_len, &dbname, &dbname_len, &port, &socket, &socket_len) == FAILURE) {
                return;