summaryrefslogtreecommitdiffstats
path: root/libiptc
diff options
context:
space:
mode:
Diffstat (limited to 'libiptc')
-rw-r--r--libiptc/libiptc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c
index 97823f93..f9b7779e 100644
--- a/libiptc/libiptc.c
+++ b/libiptc/libiptc.c
@@ -2554,8 +2554,8 @@ TC_COMMIT(struct xtc_handle *handle)
+ sizeof(STRUCT_COUNTERS) * new_number;
/* These are the old counters we will get from kernel */
- repl->counters = malloc(sizeof(STRUCT_COUNTERS)
- * handle->info.num_entries);
+ repl->counters = calloc(handle->info.num_entries,
+ sizeof(STRUCT_COUNTERS));
if (!repl->counters) {
errno = ENOMEM;
goto out_free_repl;