]> granicus.if.org Git - php/commitdiff
Fix for bug #49098
authorRasmus Lerdorf <rasmus@php.net>
Thu, 12 Nov 2009 08:20:57 +0000 (08:20 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Thu, 12 Nov 2009 08:20:57 +0000 (08:20 +0000)
ext/mysqli/mysqli_nonapi.c

index 74e11ea9fc8528ec4907c8403f5fc2e65613e2c9..7400641110eddf119052e57f9c688e3a55fa1035 100644 (file)
@@ -41,7 +41,11 @@ static void php_mysqli_set_error(long mysql_errno, char *mysql_err TSRMLS_DC)
        if (MyG(error_msg)) {
                efree(MyG(error_msg));
        }
-       MyG(error_msg) = estrdup(mysql_err);
+       if(mysql_err && *mysql_err) {
+               MyG(error_msg) = estrdup(mysql_err);
+       } else {
+               MyG(error_msg) = NULL;
+       }
 }
 /* }}} */