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:
parent
8448472dcc
commit
b8ee886a60
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user