summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2012-07-09 11:49:32 -0400
committerStephen Gallagher <sgallagh@redhat.com>2012-07-09 13:49:21 -0400
commitd6133b04d4ee47f147db26cd732ea5d209af5b8e (patch)
tree06698137e345d2549d4909d2e93f460e5f05d4ea
parentd7abad9b7a25ad82c5290ce6abecfd2f0e6da03b (diff)
downloadsssd_unused-d6133b04d4ee47f147db26cd732ea5d209af5b8e.tar.gz
sssd_unused-d6133b04d4ee47f147db26cd732ea5d209af5b8e.tar.xz
sssd_unused-d6133b04d4ee47f147db26cd732ea5d209af5b8e.zip
Fix potential NULL-dereference
Coverity #12797
-rw-r--r--src/providers/ldap/sdap_async_sudo_hostinfo.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/providers/ldap/sdap_async_sudo_hostinfo.c b/src/providers/ldap/sdap_async_sudo_hostinfo.c
index 99a9bc77..82b63296 100644
--- a/src/providers/ldap/sdap_async_sudo_hostinfo.c
+++ b/src/providers/ldap/sdap_async_sudo_hostinfo.c
@@ -281,7 +281,9 @@ static int sdap_sudo_get_ip_addresses(TALLOC_CTX *mem_ctx, char ***_ip_addr_list
ip_addr, network_addr, netmask));
}
- ip_addr_list[addr_count] = NULL;
+ if (ip_addr_list) {
+ ip_addr_list[addr_count] = NULL;
+ }
*_ip_addr_list = talloc_steal(mem_ctx, ip_addr_list);
done: