summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBo Yang <boyang@samba.org>2009-11-30 17:30:25 +0800
committerBo Yang <boyang@samba.org>2009-11-30 19:22:47 +0800
commit62a27325d99cf4371fe98d049110e585dd209c98 (patch)
treef5b46291d51667ed774dfe30c437fc0cea2b1838
parentb03ad70848e6ea889f382c0cb9f21057370f1ab6 (diff)
downloadsamba-62a27325d99cf4371fe98d049110e585dd209c98.tar.gz
samba-62a27325d99cf4371fe98d049110e585dd209c98.tar.bz2
samba-62a27325d99cf4371fe98d049110e585dd209c98.zip
s3: Fix crash in free_file_list().
Signed-off-by: Bo Yang <boyang@samba.org>
-rw-r--r--source3/param/loadparm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 29e3a2509f..a1f5328763 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -7016,6 +7016,7 @@ static void add_to_file_list(const char *fname, const char *subfname)
}
f->subfname = SMB_STRDUP(subfname);
if (!f->subfname) {
+ SAFE_FREE(f->name);
SAFE_FREE(f);
return;
}
@@ -7026,6 +7027,7 @@ static void add_to_file_list(const char *fname, const char *subfname)
if (t)
f->modtime = t;
}
+ return;
}
/**
@@ -7113,9 +7115,8 @@ bool lp_file_list_changed(void)
ctime(&mod_time)));
f->modtime = mod_time;
SAFE_FREE(f->subfname);
- f->subfname = n2; /* Passing ownership of
- return from alloc_sub_basic
- above. */
+ f->subfname = SMB_STRDUP(n2);
+ TALLOC_FREE(n2);
return true;
}
TALLOC_FREE(n2);