Merge pull request #2065 from taosdata/hotfix/sangshuduo/fix-resource-leak-in-mgmtTable.c

fix resource leak in mgmtTable.c
This commit is contained in:
Shengliang Guan 2020-05-28 18:48:33 +08:00 committed by GitHub
commit 07b81a18a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -233,7 +233,10 @@ static int32_t mgmtChildTableActionDecode(SSdbOper *pOper) {
if (pTable == NULL) return TSDB_CODE_SERV_OUT_OF_MEMORY;
int32_t len = strlen(pOper->rowData);
if (len > TSDB_TABLE_ID_LEN) return TSDB_CODE_INVALID_TABLE_ID;
if (len > TSDB_TABLE_ID_LEN) {
free(pTable);
return TSDB_CODE_INVALID_TABLE_ID;
}
pTable->info.tableId = strdup(pOper->rowData);
len++;