]> granicus.if.org Git - php/commitdiff
Add a test case for the recently fixed memleak
authorAndrey Hristov <andrey@php.net>
Thu, 29 Apr 2010 13:19:57 +0000 (13:19 +0000)
committerAndrey Hristov <andrey@php.net>
Thu, 29 Apr 2010 13:19:57 +0000 (13:19 +0000)
ext/mysqli/tests/mysqli_options.phpt

index 1d5955b55e33c217bb751eb26c575bdbbdb23ba0..de23adefad8311c748061366bc0a335440654460 100644 (file)
@@ -53,6 +53,10 @@ already through other measures.
 
        $link = mysqli_init();
 
+       /* set it twice, checking if memory for the previous one is correctly freed */
+       mysqli_options($link, MYSQLI_SET_CHARSET_NAME, "utf8");
+       mysqli_options($link, MYSQLI_SET_CHARSET_NAME, "latin1");
+
        if (!is_null($tmp = @mysqli_options($link, MYSQLI_OPT_CONNECT_TIMEOUT)))
                printf("[003] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);