]> granicus.if.org Git - vim/commitdiff
patch 9.0.0999: memory may leak v9.0.0999
authorBram Moolenaar <Bram@vim.org>
Sat, 3 Dec 2022 13:52:24 +0000 (13:52 +0000)
committerBram Moolenaar <Bram@vim.org>
Sat, 3 Dec 2022 13:52:24 +0000 (13:52 +0000)
Problem:    Memory may leak.
Solution:   Free the sound callback function name if it was allocated.

src/sound.c
src/version.c

index 17ff78ba3acdb223c02606dd84bdc263aa2153bb..edb606a2d04edfb515d9ec11da9c27e278e7c4e6 100644 (file)
@@ -60,6 +60,8 @@ get_sound_callback(typval_T *arg)
        soundcb->snd_next = first_callback;
        first_callback = soundcb;
        set_callback(&soundcb->snd_callback, &callback);
+       if (callback.cb_free_name)
+           vim_free(callback.cb_name);
     }
     return soundcb;
 }
index da9b03a522996f5a5786f942d409feda6e6fea17..b3a8ba4ebf31f03673d42936c5cf70d5978c6e63 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    999,
 /**/
     998,
 /**/