Release buffer in case of error -- CID 385075 (#15090)
Stelios Fragkakis committed
May 24, 2023 at 09:58 UTC
66afcddde9c00b33059f22a58c03cd7742663056
1 file changed
+1
database/sqlite/sqlite_health.c
+1
@@ -1222,6 +1222,7 @@ void sql_health_alarm_log2json(RRDHOST *host, BUFFER *wb, uint32_t after, char *
1222
rc = sqlite3_prepare_v2(db_meta, buffer_tostring(command), -1, &res, 0);
1223
if (unlikely(rc != SQLITE_OK)) {
1224
error_report("Failed to prepare statement SQL_SELECT_HEALTH_LOG");
1225
+ buffer_free(command);
1226
return;
1227
}
1228