b4n commented on this pull request.


> +     if (count == 0)
+       {
+               *recent_terms = NULL;
+               return;
+       }
+
+       *recent_terms = g_new0(gchar*, count + 1);
+
+       if (gtk_tree_model_get_iter_first(model, &iter))
+       {
+               do
+               {
+                       gtk_tree_model_get(model, &iter, 0, &combo_text, -1);
+                       if (*combo_text != 0)
+                       {
+                               (*recent_terms)[i] = g_strdup(combo_text);

you could avoid having to duplicate the `combo_text` if you freed it 
conditionally:

```C
if (NZV(combo_text))
{
        (*recent_terms)[i] = combo_text;
}
else
{
        g_free(combo_text);
}
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1745#pullrequestreview-91310148

Reply via email to