yanglint BUGFIX memory leaks
diff --git a/tools/lint/configuration.c b/tools/lint/configuration.c
index 549b5a6..f74cf6d 100644
--- a/tools/lint/configuration.c
+++ b/tools/lint/configuration.c
@@ -77,6 +77,7 @@
history_file = malloc(strlen(yl_dir) + 9);
if (!history_file) {
fprintf(stderr, "Memory allocation failed (%s).\n", strerror(errno));
+ free(yl_dir);
return;
}
@@ -103,6 +104,7 @@
history_file = malloc(strlen(yl_dir) + 9);
if (!history_file) {
fprintf(stderr, "Memory allocation failed (%s).\n", strerror(errno));
+ free(yl_dir);
return;
}