aboutsummaryrefslogtreecommitdiff
path: root/libssh/pcap.c
diff options
context:
space:
mode:
Diffstat (limited to 'libssh/pcap.c')
-rw-r--r--libssh/pcap.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libssh/pcap.c b/libssh/pcap.c
index 4781f5a..7ee412b 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