diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-01-13 15:13:40 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-01-13 23:14:13 +0000 |
commit | 63a3d043e3f14eebb0798a250d9aecdc8e89dfb9 (patch) | |
tree | 69a58dd4cadfc7f98669cba229e76fa8c60e0761 /ui/ssl_key_export.c | |
parent | 9f5e4fb7a51741a286ce5bc92a6f335ed58587a2 (diff) | |
download | wireshark-63a3d043e3f14eebb0798a250d9aecdc8e89dfb9.tar.gz |
Consistently use the "g_string_free returns a C string pointer" idiom.
g_string_free(str, FALSE) frees the GString container but not the
underlying g_malloc()ed string; instead, it returns a pointer to the
g_malloc()ed string.
Fix those places that didn't already get the string pointer from
g_string_free() to do so rather than manually extracting the string
themselves.
And fix one place that didn't even need to use a string - it was just
scanning a C string without even modifying it.
Change-Id: Ibbf4872bf5b9935b9907f539b6edb1013f3053a5
Reviewed-on: https://code.wireshark.org/review/6532
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/ssl_key_export.c')
-rw-r--r-- | ui/ssl_key_export.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/ui/ssl_key_export.c b/ui/ssl_key_export.c index adff4f0bab..30031bfbc1 100644 --- a/ui/ssl_key_export.c +++ b/ui/ssl_key_export.c @@ -69,7 +69,6 @@ gchar* ssl_export_sessions(void) { GString* keylist = g_string_new(""); - gchar *session_keys; /* Output format is: * "RSA Session-ID:xxxx Master-Key:yyyy\n" @@ -80,9 +79,7 @@ ssl_export_sessions(void) g_hash_table_foreach(ssl_session_hash, ssl_export_sessions_func, (gpointer)keylist); - session_keys = keylist->str; - g_string_free(keylist, FALSE); - return session_keys; + return g_string_free(keylist, FALSE); } /* |