r24826: Fix two memleaks in idmap_cache.c, bug 4917
authorVolker Lendecke <vlendec@samba.org>
Fri, 31 Aug 2007 09:39:11 +0000 (09:39 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:30:25 +0000 (12:30 -0500)
Thanks again to Patrick Rynhart for persisting :-)

Simo, please check!

source/nsswitch/idmap_cache.c

index fa44617a8c4f4198a3d62edd960fc57ffe614390..4f01cb1392d44e8ee75433cecdf9205e3bfa74ee 100644 (file)
@@ -344,7 +344,8 @@ NTSTATUS idmap_cache_map_sid(struct idmap_cache_ctx *cache, struct id_map *id)
 
        if (databuf.dptr == NULL) {
                DEBUG(10, ("Cache entry with key = %s couldn't be found\n", sidkey));
-               return NT_STATUS_NONE_MAPPED;
+               ret = NT_STATUS_NONE_MAPPED;
+               goto done;
        }
 
        t = strtol((const char *)databuf.dptr, &endptr, 10);
@@ -452,7 +453,8 @@ NTSTATUS idmap_cache_map_id(struct idmap_cache_ctx *cache, struct id_map *id)
 
        if (databuf.dptr == NULL) {
                DEBUG(10, ("Cache entry with key = %s couldn't be found\n", idkey));
-               return NT_STATUS_NONE_MAPPED;
+               ret = NT_STATUS_NONE_MAPPED;
+               goto done;
        }
 
        t = strtol((const char *)databuf.dptr, &endptr, 10);