summaryrefslogtreecommitdiff
path: root/ext/mysqli
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysqli')
-rw-r--r--ext/mysqli/mysqli_nonapi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c
index 187b9bec30..9b384132fc 100644
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -46,7 +46,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;
+ }
}
/* }}} */