freerdp-channels: freerdp_channels_send_event free event in case of error #302

Merged
merged 1 commit into from Dec 22, 2011
View
3 libfreerdp-channels/libchannels.c
@@ -46,6 +46,7 @@
#include <freerdp/utils/mutex.h>
#include <freerdp/utils/wait_obj.h>
#include <freerdp/utils/load_plugin.h>
+#include <freerdp/utils/event.h>
#include "libchannels.h"
@@ -802,13 +803,15 @@ FREERDP_API int freerdp_channels_send_event(rdpChannels* chan_man, RDP_EVENT* ev
if (name == NULL)
{
DEBUG_CHANNELS("unknown event_class %d", event->event_class);
+ freerdp_event_free(event);
return 1;
}
lchan_data = freerdp_channels_find_channel_data_by_name(chan_man, name, &index);
if (lchan_data == NULL)
{
DEBUG_CHANNELS("could not find channel name %s", name);
+ freerdp_event_free(event);
return 1;
}
if (lchan_data->open_event_proc != NULL)