fixed segmentation fault on --save_rcascan
@@ -419,6 +419,7 @@ if(fd_socket_gpsd > 0)
perror("failed to close gpsd socket");
}
}
+
if(fd_weppcapng > 0)
{
writeisb(fd_weppcapng, 0, timestampstart, incommingcount);
@@ -456,6 +457,26 @@ if(fd_pcapng > 0)
}
}
+if(rcascanflag == true)
+ {
+ if(fd_rcascanpcapng > 0)
+ {
+ writeisb(fd_rcascanpcapng, 0, timestampstart, incommingcount);
+ if(fsync(fd_rcascanpcapng) != 0)
+ {
+ perror("failed to sync pcapng file");
+ }
+ if(close(fd_rcascanpcapng) != 0)
+ {
+ perror("failed to close pcapng file");
+ }
+ }
+ if(rcascanlistname != NULL)
+ {
+ saveapinfo();
+ }
+ }
+
if(fd_socket_mcsrv > 0)
{
if(close(fd_socket_mcsrv) != 0)
@@ -501,26 +522,6 @@ if(pownedlist != NULL)
free(pownedlist);
}
-if(rcascanflag == true)
- {
- if(fd_rcascanpcapng > 0)
- {
- writeisb(fd_rcascanpcapng, 0, timestampstart, incommingcount);
- if(fsync(fd_rcascanpcapng) != 0)
- {
- perror("failed to sync pcapng file");
- }
- if(close(fd_rcascanpcapng) != 0)
- {
- perror("failed to close pcapng file");
- }
- }
- if(rcascanlistname != NULL)
- {
- saveapinfo();
- }
- }
-
printf("\nterminated...\e[?25h\n");
if(poweroffflag == true)
{
