(add_addrs): handle the case where addr->len == 0 and n == 0, then

realloc might return NULL.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16788 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-03-07 19:38:09 +00:00
parent 203072d917
commit ac1c623242

View File

@@ -50,7 +50,7 @@ add_addrs(krb5_context context,
++n;
tmp = realloc(addr->val, (addr->len + n) * sizeof(*addr->val));
if (tmp == NULL) {
if (tmp == NULL && (addr->len + n) != 0) {
krb5_set_error_string(context, "malloc: out of memory");
ret = ENOMEM;
goto fail;