1
0
forked from aniani/vim

patch 9.0.0999: memory may leak

Problem:    Memory may leak.
Solution:   Free the sound callback function name if it was allocated.
This commit is contained in:
Bram Moolenaar
2022-12-03 13:52:24 +00:00
parent 1b73edd9ee
commit c0370529c0
2 changed files with 4 additions and 0 deletions

View File

@@ -60,6 +60,8 @@ get_sound_callback(typval_T *arg)
soundcb->snd_next = first_callback; soundcb->snd_next = first_callback;
first_callback = soundcb; first_callback = soundcb;
set_callback(&soundcb->snd_callback, &callback); set_callback(&soundcb->snd_callback, &callback);
if (callback.cb_free_name)
vim_free(callback.cb_name);
} }
return soundcb; return soundcb;
} }

View File

@@ -695,6 +695,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
999,
/**/ /**/
998, 998,
/**/ /**/