mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -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;
|
if (!document->height) return;
|
||||||
|
|
||||||
|
mem_free_if(document->lines1);
|
||||||
document->lines1 = mem_calloc(document->height, sizeof(*document->lines1));
|
document->lines1 = mem_calloc(document->height, sizeof(*document->lines1));
|
||||||
|
mem_free_if(document->lines2);
|
||||||
if (!document->lines1) return;
|
if (!document->lines1) return;
|
||||||
document->lines2 = mem_calloc(document->height, sizeof(*document->lines2));
|
document->lines2 = mem_calloc(document->height, sizeof(*document->lines2));
|
||||||
if (!document->lines2) {
|
if (!document->lines2) {
|
||||||
|
Loading…
Reference in New Issue
Block a user