fix memory leak when calloc sqlstr error.
This commit is contained in:
parent
4697cdfdaf
commit
3500811178
|
@ -623,6 +623,7 @@ TAOS_STREAM *taos_open_stream(TAOS *taos, const char *sqlstr, void (*fp)(void *p
|
||||||
if (pSql->sqlstr == NULL) {
|
if (pSql->sqlstr == NULL) {
|
||||||
tscError("0x%"PRIx64" failed to malloc sql string buffer", pSql->self);
|
tscError("0x%"PRIx64" failed to malloc sql string buffer", pSql->self);
|
||||||
tscFreeSqlObj(pSql);
|
tscFreeSqlObj(pSql);
|
||||||
|
free(pStream);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue