]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Fix two memory leaks in an error path in idmap.c
authorVolker Lendecke <vl@samba.org>
Wed, 2 Jul 2008 10:22:15 +0000 (12:22 +0200)
committerVolker Lendecke <vl@samba.org>
Wed, 2 Jul 2008 11:34:09 +0000 (13:34 +0200)
source/winbindd/idmap.c

index 8b16f27f7dac147d36f8a118e37f5abab7aaed25..c0565964702d2d39d097a1c862d9a3adeee3c1a3 100644 (file)
@@ -154,6 +154,7 @@ NTSTATUS smb_register_idmap(int version, const char *name,
        entry->name = talloc_strdup(idmap_ctx, name);
        if ( ! entry->name) {
                DEBUG(0,("Out of memory!\n"));
+               TALLOC_FREE(entry);
                return NT_STATUS_NO_MEMORY;
        }
        entry->methods = methods;
@@ -207,6 +208,7 @@ NTSTATUS smb_register_idmap_alloc(int version, const char *name,
        entry->name = talloc_strdup(idmap_ctx, name);
        if ( ! entry->name) {
                DEBUG(0,("Out of memory!\n"));
+               TALLOC_FREE(entry);
                return NT_STATUS_NO_MEMORY;
        }
        entry->methods = methods;