init: fix codedex

Signed-off-by: sun_fan <sun_fan1@hoperun.com>
This commit is contained in:
sun_fan 2021-09-14 17:45:55 +08:00
parent 8a7090238a
commit 544c3a1c86
3 changed files with 3 additions and 1 deletions

View File

@ -70,6 +70,8 @@ static int LoadParamLabels(const char *fileName, SecurityLabelFunc label, void *
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));
PARAM_CHECK(info != NULL, (void)fclose(fp);
return -1, "Failed to malloc for %s", fileName);
char buff[PARAM_BUFFER_SIZE];
int infoCount = 0;
ParamAuditData auditData = {};

View File

@ -71,6 +71,7 @@ int ReadFileInDir(const char *dirPath, const char *includeExt,
processFile(fileName, context);
}
}
free(fileName);
closedir(pDir);
return 0;
}

View File

@ -27,7 +27,6 @@
#include "init_service_manager.h"
#ifndef OHOS_LITE
#include "init_param.h"
#include "uv.h"
#endif