From 4de841c26b7208d5395da349ea16c937b1361414 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Tue, 29 Aug 2017 13:14:25 +0200 Subject: lib, ipcpd, irmd: Fix bugs reported by static analysis This fixes several bugs as reported by the clang static analyzer. --- src/ipcpd/shim-eth-llc/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/ipcpd/shim-eth-llc') diff --git a/src/ipcpd/shim-eth-llc/main.c b/src/ipcpd/shim-eth-llc/main.c index 3d186d7a..e5f0cba8 100644 --- a/src/ipcpd/shim-eth-llc/main.c +++ b/src/ipcpd/shim-eth-llc/main.c @@ -166,11 +166,13 @@ static int eth_llc_data_init(void) int ret = -ENOMEM; pthread_condattr_t cattr; - eth_llc_data.fd_to_ef = malloc(sizeof(struct ef) * SYS_MAX_FLOWS); + eth_llc_data.fd_to_ef = + malloc(sizeof(*eth_llc_data.fd_to_ef) * SYS_MAX_FLOWS); if (eth_llc_data.fd_to_ef == NULL) goto fail_fd_to_ef; - eth_llc_data.ef_to_fd = malloc(sizeof(struct ef) * MAX_SAPS); + eth_llc_data.ef_to_fd = + malloc(sizeof(*eth_llc_data.ef_to_fd) * MAX_SAPS); if (eth_llc_data.ef_to_fd == NULL) goto fail_ef_to_fd; -- cgit v1.2.3