aboutsummaryrefslogtreecommitdiffstats
path: root/capture.c
diff options
context:
space:
mode:
authorJaap Keuter <jaap.keuter@xs4all.nl>2007-06-11 06:40:56 +0000
committerJaap Keuter <jaap.keuter@xs4all.nl>2007-06-11 06:40:56 +0000
commit1e2e9d4f7e7be3904ff090359f994d1fb511b397 (patch)
tree49669e55078449d2a71f6ec41f904591032de206 /capture.c
parent3f3efe41da4d6260fbd567659e38d8b1e9cd18bd (diff)
Fix segmentation fault when NULL err_msg pointer passed to capture_interface_list() and sync_list_interface_open() fails.
svn path=/trunk/; revision=22073
Diffstat (limited to 'capture.c')
-rw-r--r--capture.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/capture.c b/capture.c
index f3cdee6e16..c0e918a70a 100644
--- a/capture.c
+++ b/capture.c
@@ -602,12 +602,16 @@ capture_interface_list(int *err, char **err_str)
/* Try to get our interface list */
*err = sync_interface_list_open(&msg);
- if(*err != 0) {
+ if (*err != 0) {
g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture Interface List failed!");
- if (*err_str)
- *err_str = msg;
- else
+ if (err_str) {
+ if (*err_str)
+ *err_str = msg;
+ else
+ g_free(msg);
+ } else {
g_free(msg);
+ }
return NULL;
}