1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

sort_links: fix memory leak

Free document->lines1 and document->lines2 if they are already set. This
fixes a memory leak from commit 52d3a6411d.
This commit is contained in:
Miciah Dashiel Butler Masters 2006-02-03 20:12:24 +00:00 committed by Miciah Dashiel Butler Masters
parent 8448472dcc
commit b8ee886a60

View File

@ -512,7 +512,9 @@ sort_links(struct document *document)
if (!document->height) return;
mem_free_if(document->lines1);
document->lines1 = mem_calloc(document->height, sizeof(*document->lines1));
mem_free_if(document->lines2);
if (!document->lines1) return;
document->lines2 = mem_calloc(document->height, sizeof(*document->lines2));
if (!document->lines2) {