This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Review at https://gerrit.osmocom.org/4861
memleak: osmo_config_list_parse: getline() needs free also on error
Helps fix sanitizer build on debian 9.
Change-Id: Iddf0a6cc733cd81d5f6c1eb62fc079ad319db119
---
M src/msgfile.c
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/61/4861/1
diff --git a/src/msgfile.c b/src/msgfile.c
index 278b9a7..1f11aa6 100644
--- a/src/msgfile.c
+++ b/src/msgfile.c
@@ -119,9 +119,10 @@
line = NULL;
while (getline(&line, &n, file) != -1) {
handle_line(entries, line);
- free(line);
- line = NULL;
}
+ /* The returned getline() buffer needs to be freed even if it failed. It can simply re-use the
+ * buffer that was allocated on the first call. */
+ free(line);
fclose(file);
return entries;
--
To view, visit https://gerrit.osmocom.org/4861
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iddf0a6cc733cd81d5f6c1eb62fc079ad319db119
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>