s3:winbindd fix a return code check
authorChristian Ambach <ambi@samba.org>
Wed, 24 Aug 2011 14:21:37 +0000 (16:21 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 11 Oct 2011 13:20:56 +0000 (15:20 +0200)
talloc_traverse_dict will return with -1 in case of an error and
might return positive values that indicate the count of found
entries

source3/winbindd/winbindd_group.c

index a985fa254fedbc7bb608765fccf27afbc00ca9c0..9cc1d1467ef9829f9f1fb956e34527b05a729809 100644 (file)
@@ -115,7 +115,7 @@ NTSTATUS winbindd_print_groupmembers(struct talloc_dict *members,
        c.len = 0;
 
        res = talloc_dict_traverse(members, getgr_calc_memberlen, &c);
-       if (res != 0) {
+       if (res == -1) {
                DEBUG(5, ("talloc_dict_traverse failed\n"));
                return NT_STATUS_INTERNAL_ERROR;
        }
@@ -128,7 +128,7 @@ NTSTATUS winbindd_print_groupmembers(struct talloc_dict *members,
        }
 
        res = talloc_dict_traverse(members, getgr_unparse_members, &m);
-       if (res != 0) {
+       if (res == -1) {
                DEBUG(5, ("talloc_dict_traverse failed\n"));
                TALLOC_FREE(m.buf);
                return NT_STATUS_INTERNAL_ERROR;