]> granicus.if.org Git - php/commitdiff
Don't copy the filename when it is not needed
authorMarcus Boerger <helly@php.net>
Sat, 21 Jun 2003 18:43:25 +0000 (18:43 +0000)
committerMarcus Boerger <helly@php.net>
Sat, 21 Jun 2003 18:43:25 +0000 (18:43 +0000)
ext/dba/dba.c

index f54077b2ba016ec55d89ec20c78df29a18c4550b..49b57efad293249128c6204e23504dd6552f1e42 100644 (file)
@@ -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 */