From 2b108483ce01ef2e4cb4ed84ec201ea5ebf61b27 Mon Sep 17 00:00:00 2001 From: milo Date: Sun, 8 Aug 2010 22:57:30 +0200 Subject: pcap: Zero the pcap structure. Signed-off-by: Andreas Schneider --- libssh/pcap.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libssh') diff --git a/libssh/pcap.c b/libssh/pcap.c index 4781f5aa..7ee412b4 100644 --- a/libssh/pcap.c +++ b/libssh/pcap.c @@ -122,7 +122,15 @@ struct ssh_pcap_file_struct { * @brief create a new ssh_pcap_file object */ ssh_pcap_file ssh_pcap_file_new(){ - return malloc(sizeof(struct ssh_pcap_file_struct)); + struct ssh_pcap_file_struct *pcap; + + pcap = malloc(sizeof(struct ssh_pcap_file_struct)); + if (pcap == NULL) { + return NULL; + } + ZERO_STRUCTP(pcap); + + return pcap; } /** @internal -- cgit v1.2.3