diff --git a/client/config.c b/client/config.c index ecc126ff4..a09564b70 100644 --- a/client/config.c +++ b/client/config.c @@ -123,17 +123,18 @@ get_config_entry(char * in_data, const char *section, const char *key) line++; p = strchr(line, ']'); if (p) { - tmp = strndup(line, p - line); if (in_section) { /* We exited the matching section without a match */ free(data); return NULL; } + tmp = strndup(line, p - line); if (strcmp(section, tmp) == 0) { free(tmp); in_section = 1; continue; } + free(tmp); } } /* [ */