diff --git a/libnfc/conf.c b/libnfc/conf.c index 87aec26..ca5f801 100644 --- a/libnfc/conf.c +++ b/libnfc/conf.c @@ -66,6 +66,7 @@ conf_parse_file(const char *filename, void (*conf_keyvalue)(void *data, const ch regmatch_t *pmatch = malloc(sizeof(*pmatch) * nmatch); if (!pmatch) { log_put(LOG_GROUP, LOG_CATEGORY, NFC_LOG_PRIORITY_ERROR, "%s", "Not enough memory: malloc failed."); + regfree(&preg); return false; } @@ -98,6 +99,7 @@ conf_parse_file(const char *filename, void (*conf_keyvalue)(void *data, const ch } free(pmatch); + regfree(&preg); return false; }