diff options
author | Bill Meier <wmeier@newsguy.com> | 2008-08-15 13:05:20 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2008-08-15 13:05:20 +0000 |
commit | 23b165c6e1fd2a5503529ab6a794daba7edba5bc (patch) | |
tree | f96a621cec7d3174c40fa15dca9ac1e67f0155cc /capture.c | |
parent | 6b1c605ca4f762c0c8341392ae2d2e180194497d (diff) | |
download | wireshark-23b165c6e1fd2a5503529ab6a794daba7edba5bc.tar.gz wireshark-23b165c6e1fd2a5503529ab6a794daba7edba5bc.tar.bz2 wireshark-23b165c6e1fd2a5503529ab6a794daba7edba5bc.zip |
Fix some incorrect code (found by valgrind).
svn path=/trunk/; revision=26032
Diffstat (limited to 'capture.c')
-rw-r--r-- | capture.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -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; } |