The "get" functions already do this and some callers rely on it also for
"add" ones.
For completeness also handle it in free_idcache().
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
void free_idcache(struct idcache *ic)
{
- struct identry *ent = ic->ent;
+ struct identry *ent;
+
+ if (!ic)
+ return;
+
+ ent = ic->ent;
while (ent) {
struct identry *next = ent->next;
struct identry *ent, *x;
int w = 0;
+ if (!ic)
+ return;
+
ent = calloc(1, sizeof(struct identry));
if (!ent)
return;