lavfi/f_sendcmd: clear Command on alloc failure

If the command array failed to allocate, the current parsed
Command has to be cleared, else memory allocated for it
would be leaked.

Fix CID 1638635
This commit is contained in:
Marvin Scholz 2025-01-30 00:57:25 +01:00
parent 2c3ac6e0fa
commit 089e69dfe4

View File

@ -257,6 +257,7 @@ static int parse_commands(Command **cmds, int *nb_cmds, int interval_count,
if (!*cmds) {
av_log(log_ctx, AV_LOG_ERROR,
"Could not (re)allocate command array\n");
clear_command(&cmd);
return AVERROR(ENOMEM);
}
}