diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2012-07-09 11:49:32 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-07-09 13:49:21 -0400 |
commit | d6133b04d4ee47f147db26cd732ea5d209af5b8e (patch) | |
tree | 06698137e345d2549d4909d2e93f460e5f05d4ea | |
parent | d7abad9b7a25ad82c5290ce6abecfd2f0e6da03b (diff) | |
download | sssd-d6133b04d4ee47f147db26cd732ea5d209af5b8e.tar.gz sssd-d6133b04d4ee47f147db26cd732ea5d209af5b8e.tar.xz sssd-d6133b04d4ee47f147db26cd732ea5d209af5b8e.zip |
Fix potential NULL-dereference
Coverity #12797
-rw-r--r-- | src/providers/ldap/sdap_async_sudo_hostinfo.c | 4 |
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 99a9bc77a..82b632961 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: |