aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
authormilo <milo@r0ot.me>2010-08-08 22:57:30 +0200
committerAndreas Schneider <asn@cynapses.org>2010-08-09 20:54:01 +0200
commit2b108483ce01ef2e4cb4ed84ec201ea5ebf61b27 (patch)
treecab2fb1ac03c7ed231c841b68cc1afae9e5bacdf /libssh
parent23c745d3350f875ae5f7646ae1d370d8dfd9ca8a (diff)
downloadlibssh-2b108483ce01ef2e4cb4ed84ec201ea5ebf61b27.tar.gz
libssh-2b108483ce01ef2e4cb4ed84ec201ea5ebf61b27.tar.xz
libssh-2b108483ce01ef2e4cb4ed84ec201ea5ebf61b27.zip
pcap: Zero the pcap structure.
Signed-off-by: Andreas Schneider <asn@cynapses.org>
Diffstat (limited to 'libssh')
-rw-r--r--libssh/pcap.c10
1 files changed, 9 insertions, 1 deletions
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