From 2c2068402ff205c07ee3f8234a45ff07608f6323 Mon Sep 17 00:00:00 2001 From: "xionglei6@huawei.com" Date: Tue, 14 Sep 2021 10:07:25 +0800 Subject: [PATCH] fix code style Signed-off-by: xionglei6@huawei.com --- services/param/adapter/param_dac.c | 2 +- services/param/adapter/param_selinux.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/param/adapter/param_dac.c b/services/param/adapter/param_dac.c index 4560c6c7..11adc177 100755 --- a/services/param/adapter/param_dac.c +++ b/services/param/adapter/param_dac.c @@ -111,7 +111,7 @@ static int LoadParamLabels(const char *fileName, SecurityLabelFunc label, void * FILE *fpForGroup = fopen(GROUP_FILE_PATH, "r"); FILE *fpForUser = fopen(USER_FILE_PATH, "r"); FILE *fp = fopen(fileName, "r"); - SubStringInfo *info = malloc(sizeof(SubStringInfo) * SUBSTR_INFO_DAC + 1); + SubStringInfo *info = malloc(sizeof(SubStringInfo) * (SUBSTR_INFO_DAC + 1)); PARAM_CHECK(fpForGroup != NULL && fpForUser != NULL && fp != NULL && info != NULL, goto exit, "Can not open file for load param labels"); diff --git a/services/param/adapter/param_selinux.c b/services/param/adapter/param_selinux.c index 81b3fc0c..1425690e 100755 --- a/services/param/adapter/param_selinux.c +++ b/services/param/adapter/param_selinux.c @@ -69,7 +69,7 @@ static int LoadParamLabels(const char *fileName, SecurityLabelFunc label, void * int ret = 0; FILE *fp = fopen(fileName, "r"); PARAM_CHECK(fp != NULL, return -1, "Open file %s fail", fileName); - SubStringInfo *info = malloc(sizeof(SubStringInfo) * SUBSTR_INFO_DAC + 1); + SubStringInfo *info = malloc(sizeof(SubStringInfo) * (SUBSTR_INFO_DAC + 1)); char buff[PARAM_BUFFER_SIZE]; int infoCount = 0; ParamAuditData auditData = {}; -- GitLab