mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-10-12 08:24:52 -05:00
Fix a crash and memory leak in get_config_entry()
This commit is contained in:
1 parent
58746226d4
commit
a292e9901b
1 file changed
+2
-1
+2
-1
@@ -91,7 +91,7 @@ get_config_entry(char * in_data, const char *section, const char *key)
|
||||
if (NULL == in_data)
|
||||
return NULL;
|
||||
else
|
||||
strdup(in_data);
|
||||
data = strdup(in_data);
|
||||
|
||||
for (line = strtok_r(data, "\n", &ptr); line != NULL;
|
||||
line = strtok_r(NULL, "\n", &ptr)) {
|
||||
@@ -156,5 +156,6 @@ get_config_entry(char * in_data, const char *section, const char *key)
|
||||
}
|
||||
}
|
||||
}
|
||||
free(data);
|
||||
return NULL;
|
||||
}
|
||||
Reference in new issue
Block a user