!120 【轻量级 PR】: 添加了指针释放,修复了部分内存泄漏

Merge pull request !120 from 叫我去复习/master
This commit is contained in:
opengauss-bot 2023-04-23 07:06:31 +00:00 committed by Gitee
commit 96166a0be8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 2 additions and 0 deletions

View File

@ -1656,6 +1656,7 @@ char *DoConcatCmd(const CtlOption *ctx)
int rc = memset_s(cmd, CM_PATH_LENGTH, 0, CM_PATH_LENGTH);
securec_check_errno(rc, (void)rc);
if (DoCheckRole(&ctx->dcfOption) == -1) {
free(cmd);
return NULL;
}

View File

@ -304,6 +304,7 @@ char *GetParamLineInfo(const char *paramName, const char * const *paramInfos, in
if (paramInfos == NULL) {
write_runlog(ERROR, "Fail to get param info.\n");
free(info);
return NULL;
}