channels/rail: Fix leak found by covscan

leaked_storage: Variable "s" going out of scope leaks the storage it points to.
This commit is contained in:
Ondrej Holy
2018-08-17 12:51:19 +02:00
parent 4b8f2d5137
commit 865ee84ab5

View File

@@ -910,15 +910,16 @@ UINT rail_send_client_exec_order(railPlugin* rail, RAIL_EXEC_ORDER* exec)
if ((error = rail_write_client_exec_order(s, exec)))
{
WLog_ERR(TAG, "rail_write_client_exec_order failed with error %"PRIu32"!", error);
return error;
goto out;
}
if ((error = rail_send_pdu(rail, s, RDP_RAIL_ORDER_EXEC)))
{
WLog_ERR(TAG, "rail_send_pdu failed with error %"PRIu32"!", error);
return error;
goto out;
}
out:
Stream_Free(s, TRUE);
return error;
}
@@ -972,15 +973,16 @@ static UINT rail_send_client_sysparam_order(railPlugin* rail, RAIL_SYSPARAM_ORDE
if ((error = rail_write_client_sysparam_order(s, sysparam)))
{
WLog_ERR(TAG, "rail_write_client_sysparam_order failed with error %"PRIu32"!", error);
return error;
goto out;
}
if ((error = rail_send_pdu(rail, s, RDP_RAIL_ORDER_SYSPARAM)))
{
WLog_ERR(TAG, "rail_send_pdu failed with error %"PRIu32"!", error);
return error;
goto out;
}
out:
Stream_Free(s, TRUE);
return error;
}