Merge branch 'jg/mailinfo-leakfix'

Leakfix.

* jg/mailinfo-leakfix:
  mailinfo.c: fix memory leak in function handle_content_type()
This commit is contained in:
Junio C Hamano
2025-06-25 14:07:37 -07:00

View File

@@ -266,6 +266,8 @@ static void handle_content_type(struct mailinfo *mi, struct strbuf *line)
error("Too many boundaries to handle"); error("Too many boundaries to handle");
mi->input_error = -1; mi->input_error = -1;
mi->content_top = &mi->content[MAX_BOUNDARIES] - 1; mi->content_top = &mi->content[MAX_BOUNDARIES] - 1;
strbuf_release(boundary);
free(boundary);
return; return;
} }
*(mi->content_top) = boundary; *(mi->content_top) = boundary;