updateDevice() remove element from the list when realloc fails

This commit is contained in:
Thomas Bernard 2018-12-18 20:23:47 +01:00
parent 9066896195
commit cd506a67e1
No known key found for this signature in database
GPG Key ID: 0FF11B67A5C0863C
1 changed files with 1 additions and 0 deletions

View File

@ -318,6 +318,7 @@ updateDevice(const struct header * headers, time_t t)
if(!tmp) /* allocation error */ if(!tmp) /* allocation error */
{ {
syslog(LOG_ERR, "updateDevice() : memory allocation error"); syslog(LOG_ERR, "updateDevice() : memory allocation error");
*pp = p->next; /* remove "p" from the list */
free(p); free(p);
return 0; return 0;
} }