1
0
Fork 0
forked from soccera/rdo

Fix memory leak in getconf()

As getline() calls malloc() to allocate new memory
for our usage, we have to free() it after.
This commit is contained in:
sw1tchbl4d3 2021-07-18 23:34:31 +02:00
parent 1bb71b46cc
commit 4ed6a6d75a

1
rdo.c
View file

@ -24,6 +24,7 @@ void getconf(FILE* fp, const char* entry, char* result, size_t len_result) {
if (token) {
strncpy(result, token, len_result);
result[strcspn(result, "\n")] = 0;
free(line);
return;
}
}