From: Marcus Boerger Date: Sat, 21 Jun 2003 18:43:25 +0000 (+0000) Subject: Don't copy the filename when it is not needed X-Git-Tag: RELEASE_1_0_2~115 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a332df50fb41c9a8f489ef0d113f7a4a85911b12;p=php Don't copy the filename when it is not needed --- 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 */