fix code check warning

Signed-off-by: liduo <liduo29@huawei.com>
This commit is contained in:
liduo
2024-11-15 14:20:58 +08:00
parent 806bf302e4
commit 3efb2a5786
3 changed files with 15 additions and 0 deletions
+3
View File
@@ -292,6 +292,9 @@ string CompressionParser::ParseJsonStr(const cJSON *node)
return "";
}
char *jsonString = cJSON_Print(node);
if (jsonString == nullptr) {
return "";
}
string res(jsonString);
free(jsonString);
return res;