mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-05-28 00:21:57 +02:00
patch 9.2.0258: memory leak in add_mark()
Problem: memory leak in add_mark()
Solution: Free lpos in the error case when it hasn't been added to the
dict yet (Huihui Huang)
closes: #19827
Signed-off-by: Huihui Huang <625173@qq.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
02abcf381f
commit
b90145672d
@@ -1484,7 +1484,11 @@ add_mark(list_T *l, char_u *mname, pos_T *pos, int bufnr, char_u *fname)
|
||||
if (dict_add_string(d, "mark", mname) == FAIL
|
||||
|| dict_add_list(d, "pos", lpos) == FAIL
|
||||
|| (fname != NULL && dict_add_string(d, "file", fname) == FAIL))
|
||||
{
|
||||
if (lpos->lv_refcount == 0)
|
||||
list_free(lpos);
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -734,6 +734,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
258,
|
||||
/**/
|
||||
257,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user