]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Pass "mem_ctx" down to xx_path
authorVolker Lendecke <vl@samba.org>
Thu, 16 Aug 2018 08:45:23 +0000 (10:45 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 17 Aug 2018 09:30:10 +0000 (11:30 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/lib/util_path.c

index 5b133dfdc7842ab0ed75ad835e4547b5197ec420..049ced548e2cb54ac8b38af3314fa066e1c74d18 100644 (file)
@@ -38,11 +38,13 @@ struct share_params;
  * @retval Pointer to a string containing the full path.
  **/
 
-static char *xx_path(const char *name, const char *rootpath)
+static char *xx_path(TALLOC_CTX *mem_ctx,
+                    const char *name,
+                    const char *rootpath)
 {
        char *fname = NULL;
 
-       fname = talloc_strdup(talloc_tos(), rootpath);
+       fname = talloc_strdup(mem_ctx, rootpath);
        if (!fname) {
                return NULL;
        }
@@ -65,7 +67,7 @@ static char *xx_path(const char *name, const char *rootpath)
 
 char *lock_path(const char *name)
 {
-       return xx_path(name, lp_lock_directory());
+       return xx_path(talloc_tos(), name, lp_lock_directory());
 }
 
 /**
@@ -78,7 +80,7 @@ char *lock_path(const char *name)
 
 char *state_path(const char *name)
 {
-       return xx_path(name, lp_state_directory());
+       return xx_path(talloc_tos(), name, lp_state_directory());
 }
 
 /**
@@ -91,7 +93,7 @@ char *state_path(const char *name)
 
 char *cache_path(const char *name)
 {
-       return xx_path(name, lp_cache_directory());
+       return xx_path(talloc_tos(), name, lp_cache_directory());
 }
 
 /**