From cd506a67e174a45c6a202eff182a712955ed6d6f Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Tue, 18 Dec 2018 20:23:47 +0100 Subject: [PATCH] updateDevice() remove element from the list when realloc fails --- minissdpd/minissdpd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/minissdpd/minissdpd.c b/minissdpd/minissdpd.c index 5d4a386..5c9c5d6 100644 --- a/minissdpd/minissdpd.c +++ b/minissdpd/minissdpd.c @@ -318,6 +318,7 @@ updateDevice(const struct header * headers, time_t t) if(!tmp) /* allocation error */ { syslog(LOG_ERR, "updateDevice() : memory allocation error"); + *pp = p->next; /* remove "p" from the list */ free(p); return 0; }