diff --git a/src/client/src/tscParseLineProtocol.c b/src/client/src/tscParseLineProtocol.c index 41021a4cc50bd61a1901bad0cb12f28f4e47e1c0..05d071e12072a6d83e9140c79bb319a9212896e2 100644 --- a/src/client/src/tscParseLineProtocol.c +++ b/src/client/src/tscParseLineProtocol.c @@ -2055,6 +2055,8 @@ static int32_t parseSmlKvPairs(TAOS_SML_KV **pKVs, int *num_kvs, if (!isField && (strcasecmp(pkv->key, "ID") == 0)) { ret = isValidChildTableName(pkv->value, pkv->length, info); if (ret) { + free(pkv->key); + free(pkv->value); goto error; } smlData->childTableName = malloc( pkv->length + 1); diff --git a/tests/examples/c/apitest.c b/tests/examples/c/apitest.c index 86d002f2951d9a8cd1710921c50545ded7ca42b1..d9d2a41cb2782f1e919857d3a94c5f83946bb277 100644 --- a/tests/examples/c/apitest.c +++ b/tests/examples/c/apitest.c @@ -344,12 +344,12 @@ int32_t verify_schema_less(TAOS* taos) { code = taos_schemaless_insert(taos, &lines5[0], 1, 0, "ns"); code = taos_schemaless_insert(taos, &lines5[1], 1, 0, "ns"); - char* lines6[] = { "st123456,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000", "dgtyqodr,t2=5f64,t3=L\"ste\" c1=tRue,c2=4i64,c3=\"iam\" 1626056811823316532" }; code = taos_schemaless_insert(taos, lines6, 2, 0, "ns"); + return (code); }