mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fix a crash and memory leak in get_config_entry()
This commit is contained in:
committed by
Rob Crittenden
parent
58746226d4
commit
a292e9901b
@@ -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