Fixing minor memory leak when dbPutConvertJSON call fails
This commit is contained in:
1 parent
7e3255ff8e
commit
4fe5f75387
1 file changed
+3
-1
@@ -422,8 +422,10 @@ long dbpf(const char *pname,const char *pvalue)
|
||||
return -1;
|
||||
}
|
||||
status = dbPutConvertJSON(pvalue, dbrType, array, &n);
|
||||
if (status)
|
||||
if (status) {
|
||||
free(array);
|
||||
return status;
|
||||
}
|
||||
pvalue = array;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user