s3:registry avoid leaking an old regsubkey_ctr on regsubkey_ctr_init
[ira/wip.git] / source3 / registry / reg_api.c
index 51bd98e9395becb5bd16804923e10031448356ee..c66a95e406e6ca46cd3e7568a94c7000dfd97cd8 100644 (file)
@@ -110,6 +110,7 @@ static WERROR fill_subkey_cache(struct registry_key *key)
                }
        }
 
+       TALLOC_FREE(key->subkeys);
        werr = regsubkey_ctr_init(key, &(key->subkeys));
        W_ERROR_NOT_OK_RETURN(werr);