registry: combine talloc_strdup() and normalize_reg_path() in regdb_fetch_keys().
authorMichael Adam <obnox@samba.org>
Tue, 29 Apr 2008 13:30:45 +0000 (15:30 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 30 Apr 2008 10:42:32 +0000 (12:42 +0200)
the talloc_strdup() call is just and extra allocation here.

Michael
(This used to be commit 217233349b2d98d2506fcca47858373150e89924)

source3/registry/reg_backend_db.c

index 6bd8d375fbf7b0e0107c6c23d013f7c07b526942..31ada0c85c987423d972d964af6e24176e6b2660 100644 (file)
@@ -733,13 +733,7 @@ int regdb_fetch_keys(const char *key, REGSUBKEY_CTR *ctr)
 
        DEBUG(11,("regdb_fetch_keys: Enter key => [%s]\n", key ? key : "NULL"));
 
-       path = talloc_strdup(frame, key);
-       if (!path) {
-               goto fail;
-       }
-
-       /* convert to key format */
-       path = normalize_reg_path(frame, path);
+       path = normalize_reg_path(frame, key);
        if (!path) {
                goto fail;
        }