Permalink
Browse files

[server] replay attack detection memory leak bug fix

This commit fixes the following memory leak found with valgrind:

44 bytes in 1 blocks are definitely lost in loss record 2 of 2
   at 0x482BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
   by 0x490EA50: strdup (strdup.c:43)
   by 0x10CD69: incoming_spa (incoming_spa.c:162)
   by 0x10E000: process_packet (process_packet.c:200)
   by 0x4862E63: ??? (in /usr/lib/i386-linux-gnu/libpcap.so.1.1.1)
   by 0x4865667: pcap_dispatch (in /usr/lib/i386-linux-gnu/libpcap.so.1.1.1)
   by 0x10DABF: pcap_capture (pcap_capture.c:226)
   by 0x10A798: main (fwknopd.c:299)
  • Loading branch information...
mrash committed Jul 28, 2012
1 parent 8e26cca commit 060fbb607f25ea2cd511d4cd548dc419d8eb3884
Showing with 4 additions and 0 deletions.
  1. +4 −0 server/incoming_spa.c
View
@@ -164,6 +164,7 @@ get_raw_digest(char **digest, char *pkt_data)
return SPA_MSG_ERROR;
fko_destroy(ctx);
+
return res;
}
@@ -283,7 +284,10 @@ incoming_spa(fko_srv_options_t *opts)
return;
if (is_replay(opts, raw_digest) != SPA_MSG_SUCCESS)
+ {
+ free(raw_digest);
return;
+ }
}
else
{

0 comments on commit 060fbb6

Please sign in to comment.