From: Volker Lendecke Date: Sun, 10 Apr 2016 10:51:15 +0000 (+0200) Subject: vfs_catia: Fix bug 11827, memleak X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=3e2af1568d150de1cb12fef40580f4880ac787ff;p=metze%2Fsamba%2Fwip.git vfs_catia: Fix bug 11827, memleak add_srt should add the mappings to the linked list even if mappings==NULL (the default) Bug: https://bugzilla.samba.org/show_bug.cgi?id=11827 Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Mon Apr 11 14:25:59 CEST 2016 on sn-devel-144 --- diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c index 8622c2441c49..f4c77d96b1e1 100644 --- a/source3/modules/vfs_catia.c +++ b/source3/modules/vfs_catia.c @@ -141,6 +141,9 @@ static struct share_mapping_entry *add_srt(int snum, const char **mappings) ret->snum = snum; + ret->next = srt_head; + srt_head = ret; + if (mappings) { ret->mappings = (struct char_mappings**) ((unsigned char*) ret + sizeof(struct share_mapping_entry)); @@ -176,9 +179,6 @@ static struct share_mapping_entry *add_srt(int snum, const char **mappings) } } - ret->next = srt_head; - srt_head = ret; - return ret; }