(mkt_remove_entry): realloc can return NULL on success in the case 0

entries are allocated, From Andrew Bartlet


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16352 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2005-12-05 18:39:46 +00:00
parent f223888240
commit 08b361da54

View File

@@ -215,7 +215,7 @@ mkt_remove_entry(krb5_context context,
return KRB5_KT_NOTFOUND; return KRB5_KT_NOTFOUND;
} }
e = realloc(d->entries, d->num_entries * sizeof(*d->entries)); e = realloc(d->entries, d->num_entries * sizeof(*d->entries));
if(e != NULL) if(e != NULL || d->num_entries == 0)
d->entries = e; d->entries = e;
return 0; return 0;
} }