forked from osmocom/wireshark
androiddump: Close socket on failure path
Fix a few cases where socket is not closed on failure path. Change-Id: Id116a8e5f14979f962fdf725c62999758b79109e Reviewed-on: https://code.wireshark.org/review/22481 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
parent
91e512985f
commit
f9fd438b6d
|
@ -2393,6 +2393,7 @@ static int capture_android_tcpdump(char *interface, char *fifo,
|
||||||
regex = g_regex_new(regex_linktype, (GRegexCompileFlags)0, (GRegexMatchFlags)0, &err);
|
regex = g_regex_new(regex_linktype, (GRegexCompileFlags)0, (GRegexMatchFlags)0, &err);
|
||||||
if (!regex) {
|
if (!regex) {
|
||||||
g_warning("Failed to compile regex for tcpdump data link type matching");
|
g_warning("Failed to compile regex for tcpdump data link type matching");
|
||||||
|
closesocket(sock);
|
||||||
return EXIT_CODE_GENERIC;
|
return EXIT_CODE_GENERIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2409,6 +2410,7 @@ static int capture_android_tcpdump(char *interface, char *fifo,
|
||||||
}
|
}
|
||||||
else if (errno != 0) {
|
else if (errno != 0) {
|
||||||
g_warning("ERROR capture: %s", strerror(errno));
|
g_warning("ERROR capture: %s", strerror(errno));
|
||||||
|
closesocket(sock);
|
||||||
g_regex_unref(regex);
|
g_regex_unref(regex);
|
||||||
return EXIT_CODE_GENERIC;
|
return EXIT_CODE_GENERIC;
|
||||||
}
|
}
|
||||||
|
@ -2546,6 +2548,7 @@ static int capture_android_tcpdump(char *interface, char *fifo,
|
||||||
}
|
}
|
||||||
else if (errno != 0) {
|
else if (errno != 0) {
|
||||||
g_warning("ERROR capture: %s", strerror(errno));
|
g_warning("ERROR capture: %s", strerror(errno));
|
||||||
|
closesocket(sock);
|
||||||
return EXIT_CODE_GENERIC;
|
return EXIT_CODE_GENERIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue