summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Habets <habets@google.com>2019-11-01 14:38:53 +0000
committerThomas Habets <habets@google.com>2019-11-01 14:38:53 +0000
commit636299ae0e22132dc57687c43c4c1e0278892b77 (patch)
tree37286eecc7ad41927cbbb3bb40afc8eab1a5b658
parentb2ff4a15c342bb854e2ecab7fedf2f0bbc800dca (diff)
downloadarping-636299ae0e22132dc57687c43c4c1e0278892b77.tar.gz
Alloc a whole libnet_t in mock
-rw-r--r--src/mock_libnet.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mock_libnet.c b/src/mock_libnet.c
index 9cb34f7..eb37140 100644
--- a/src/mock_libnet.c
+++ b/src/mock_libnet.c
@@ -32,10 +32,10 @@ libnet_init(int injection_type, LIBNET_INIT_CONST char *device, char *err_buf)
return NULL;
}
if (!strcmp(device, "good")) {
- return malloc(1);
+ return malloc(sizeof(libnet_t));
}
if (mock_libnet_lo_ok && !strcmp(device, "lo")) {
- return malloc(1);
+ return malloc(sizeof(libnet_t));
}
return NULL;
}