commit aa8e9a23e1a1d02c74eea2aba6a3d7105fa96293
parent d7397d956742ccb8dc9ef9203a0d03cdd13327f6
Author: Kyle Milz <kmilz@ucalgary.ca>
Date: Sun, 14 Oct 2012 23:52:21 -0600
prevent 3 memory leaks
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/commands.c b/src/commands.c
@@ -70,7 +70,7 @@ complete(const Arg *arg, void *data)
if (strncmp(commands[i].cmd, match + 1, len - 1) == 0) {
Eina_Strbuf *buf = eina_strbuf_new();
eina_strbuf_append_printf(buf, ":%s", commands[i].cmd);
- matches = eina_list_append(matches, eina_strbuf_string_get(buf));
+ matches = eina_list_append(matches, eina_strbuf_string_steal(buf));
}
}
@@ -88,7 +88,7 @@ complete(const Arg *arg, void *data)
const char *url = hist_item_url_get(hist_item);
if (strncmp(url, tokens[1], strlen(tokens[1])) == 0) {
eina_strbuf_append_printf(buf, "%s %s", tokens[0], url);
- matches = eina_list_append(matches, eina_strbuf_string_get(buf));
+ matches = eina_list_append(matches, eina_strbuf_string_steal(buf));
}
}
eina_iterator_free(it);
@@ -130,7 +130,7 @@ complete(const Arg *arg, void *data)
if (current != -1) {
Eina_Strbuf *suggestion = eina_strbuf_new();
eina_strbuf_append_printf(suggestion, "%s", (char*)eina_list_nth(matches, current));
- elm_entry_entry_set(wd->url, eina_strbuf_string_get(suggestion));
+ elm_entry_entry_set(wd->url, eina_strbuf_string_steal(suggestion));
elm_object_style_set(eina_list_nth(widgets, current), "highlighted");
} else
elm_entry_entry_set(wd->url, prefix);