pzoxiuv/Geany-Plugins — comment on commit 1300217ec40c5ecf35f201a71876fb17cb0c65b3
File: surroundText.c line 51
By codebrainz:

I guess you didn't realize it, but the `g_strdup_printf` function allocates memory which you leak when you use it like this. You need to store the pointer it returns and free it aftewards, or better yet, do something like this:

```c
gchar ins[2] = { 0, 0 }; /* insertion char and nul term */
...
ins[0] = *wrap_chars[key_id];
sci_insert_text (sci_obj, sci_get_selection_start (sci_obj), ins);
```

This would avoid the leaks and also be faster since it doesn't need to do any extra allocation or formatting for a single character.