summaryrefslogtreecommitdiff
path: root/ext/dba/dba.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-06-21 18:43:25 +0000
committerMarcus Boerger <helly@php.net>2003-06-21 18:43:25 +0000
commita332df50fb41c9a8f489ef0d113f7a4a85911b12 (patch)
tree4b0ee20c4a20cc8605172dfe0603593258b8420b /ext/dba/dba.c
parent7eb9fc251ab44320a79ed9867402852d93b9d2c5 (diff)
downloadphp-git-a332df50fb41c9a8f489ef0d113f7a4a85911b12.tar.gz
Don't copy the filename when it is not needed
Diffstat (limited to 'ext/dba/dba.c')
-rw-r--r--ext/dba/dba.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/dba/dba.c b/ext/dba/dba.c
index f54077b2ba..49b57efad2 100644
--- a/ext/dba/dba.c
+++ b/ext/dba/dba.c
@@ -719,7 +719,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (!error && lock_mode) {
if (lock_dbf) {
- lock_name = estrdup(info->path);
+ lock_name = Z_STRVAL_PP(args[0]);
} else {
spprintf(&lock_name, 0, "%s.lck", info->path);
if (!strcmp(file_mode, "r")) {
@@ -757,7 +757,9 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
}
}
- efree(lock_name);
+ if (!lock_dbf) {
+ efree(lock_name);
+ }
if (!info->lock.fp) {
dba_close(info TSRMLS_CC);
/* stream operation already wrote an error message */