s3 wbinfo: Avoid ADD_TO_ARRAY macro.
authorKai Blin <kai@samba.org>
Wed, 12 Aug 2009 14:18:54 +0000 (16:18 +0200)
committerKai Blin <kai@samba.org>
Tue, 18 Aug 2009 17:53:39 +0000 (19:53 +0200)
nsswitch/wbinfo.c

index 854dbbd516f9bad2e68604b5be825abc8dca3ca5..3cd5a29e60adbbae36a81bd869e0214b10a992c5 100644 (file)
@@ -1076,7 +1076,12 @@ static bool wbinfo_lookuprids(const char *domain, const char *arg)
 
        while (next_token_talloc(mem_ctx, &p, &ridstr, " ,\n")) {
                uint32_t rid = strtoul(ridstr, NULL, 10);
-               ADD_TO_ARRAY(mem_ctx, uint32_t, rid, &rids, &num_rids);
+               rids = talloc_realloc(mem_ctx, rids, uint32_t, num_rids + 1);
+               if (rids == NULL) {
+                       d_printf("talloc_realloc failed\n");
+               }
+               rids[num_rids] = rid;
+               num_rids += 1;
        }
 
        if (rids == NULL) {