summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@lerdorf.com>2013-10-19 19:25:25 -0700
committerRasmus Lerdorf <rasmus@lerdorf.com>2013-10-19 19:25:25 -0700
commit1ce00048fde3dda1d75a6e47921e80c9a864d992 (patch)
tree5635963cbb9b21d76a1a043c26f75acaa532da44
parent4a205092f7d474ecfe4f7e00500ec516c1d23caa (diff)
parent2be67ca457299179d5df05ee569d4efa227e33d9 (diff)
downloadphp-git-1ce00048fde3dda1d75a6e47921e80c9a864d992.tar.gz
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: Fix unitialized opened_path here - found by Coverity
-rw-r--r--ext/dba/dba.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/dba/dba.c b/ext/dba/dba.c
index 50a94dd2ad..ced90f0c62 100644
--- a/ext/dba/dba.c
+++ b/ext/dba/dba.c
@@ -625,7 +625,8 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
char *file_mode;
char mode[4], *pmode, *lock_file_mode = NULL;
int persistent_flag = persistent ? STREAM_OPEN_PERSISTENT : 0;
- char *opened_path, *lock_name;
+ char *opened_path = NULL;
+ char *lock_name;
if(ac < 2) {
WRONG_PARAM_COUNT;
@@ -848,8 +849,10 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (!persistent) {
info->lock.name = opened_path;
} else {
- info->lock.name = pestrdup(opened_path, persistent);
- efree(opened_path);
+ if (opened_path) {
+ info->lock.name = pestrdup(opened_path, persistent);
+ efree(opened_path);
+ }
}
}
}