diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-09-01 09:03:29 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-09-01 09:03:29 +0000 |
commit | 55add7077f67b75200f70119875f27f086775880 (patch) | |
tree | 40523152f48c92d78b90981383f86216eba55ecd /gtk/main.c | |
parent | 494c071cfb448597ab2967ef81c12fe9383d5ff8 (diff) |
convert one sprintf into g_snprintf()
at the same time, make proto_construct_dfilter_string() return an emem allocated string.
This fixes a tiny memleak in print.c that never freed the string returned by this function.
svn path=/trunk/; revision=15651
Diffstat (limited to 'gtk/main.c')
-rw-r--r-- | gtk/main.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gtk/main.c b/gtk/main.c index 23201d2d8b..e2aa215c96 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -65,6 +65,7 @@ #include <epan/dfilter/dfilter.h> #include <epan/strutil.h> #include <epan/addr_resolv.h> +#include <epan/emem.h> /* general (not GTK specific) */ #include "file.h" @@ -266,9 +267,6 @@ match_selected_cb_do(gpointer data, int action, gchar *text) /* Free up the new filter text. */ g_free(new_filter); - - /* Free up the generated text we were handed. */ - g_free(text); } void @@ -404,7 +402,7 @@ get_text_from_packet_list(gpointer data) strlen(cfile.cinfo.col_expr_val[column]) != 0) { len = strlen(cfile.cinfo.col_expr[column]) + strlen(cfile.cinfo.col_expr_val[column]) + 5; - buf = g_malloc0(len); + buf = ep_alloc0(len); g_snprintf(buf, len, "%s == %s", cfile.cinfo.col_expr[column], cfile.cinfo.col_expr_val[column]); } |