aboutsummaryrefslogtreecommitdiffstats
path: root/capture.c
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2008-08-15 13:05:20 +0000
committerBill Meier <wmeier@newsguy.com>2008-08-15 13:05:20 +0000
commit23b165c6e1fd2a5503529ab6a794daba7edba5bc (patch)
treef96a621cec7d3174c40fa15dca9ac1e67f0155cc /capture.c
parent6b1c605ca4f762c0c8341392ae2d2e180194497d (diff)
Fix some incorrect code (found by valgrind).
svn path=/trunk/; revision=26032
Diffstat (limited to 'capture.c')
-rw-r--r--capture.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/capture.c b/capture.c
index ae121a5d37..14dab65731 100644
--- a/capture.c
+++ b/capture.c
@@ -656,7 +656,8 @@ capture_input_closed(capture_options *capture_opts)
/**
* Fetch the interface list from a child process (dumpcap).
*
- * @return A GList containing if_info_t structs if successful, NULL otherwise.
+ * @return A GList containing if_info_t structs if successful, NULL (with err and possibly err_str set) otherwise.
+ *
*/
/* XXX - We parse simple text output to get our interface list. Should
@@ -679,10 +680,7 @@ capture_interface_list(int *err, char **err_str)
if (*err != 0) {
g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture Interface List failed!");
if (err_str) {
- if (*err_str)
- *err_str = msg;
- else
- g_free(msg);
+ *err_str = msg;
} else {
g_free(msg);
}
@@ -744,9 +742,9 @@ capture_interface_list(int *err, char **err_str)
/* Check to see if we built a list */
if (if_list == NULL) {
- if (err_str && *err_str)
- *err_str = g_strdup("No interfaces found");
*err = NO_INTERFACES_FOUND;
+ if (err_str)
+ *err_str = g_strdup("No interfaces found");
}
return if_list;
}