diff --git a/format-draw.c b/format-draw.c index c8cb74b6..03fad05f 100644 --- a/format-draw.c +++ b/format-draw.c @@ -1116,7 +1116,7 @@ format_width(const char *expanded) /* * Trim on the left, taking #[] into account. Note, we copy the whole set of * unescaped #s, but only add their escaped size to width. This is because the - * format_draw function will actually do the escaping when it runs + * format_draw function will actually do the escaping. */ char * format_trim_left(const char *expanded, u_int limit) diff --git a/format.c b/format.c index 3dadbf34..e30c67d8 100644 --- a/format.c +++ b/format.c @@ -5325,6 +5325,7 @@ done: if (marker != NULL && strcmp(new, value) != 0) { free(value); xasprintf(&value, "%s%s", new, marker); + free(new); } else { free(value); value = new; @@ -5335,6 +5336,7 @@ done: if (marker != NULL && strcmp(new, value) != 0) { free(value); xasprintf(&value, "%s%s", marker, new); + free(new); } else { free(value); value = new;