Fix the memory leak in the udp multirecv

This commit is contained in:
Jaroslav Kysela 2014-05-08 22:41:44 +02:00
parent 81691e2e1f
commit 86a134481d
2 changed files with 5 additions and 4 deletions

View file

@ -102,7 +102,7 @@ typedef struct source_info {
static inline void
lock_assert0(pthread_mutex_t *l, const char *file, int line)
{
#if ENABLE_LOCKOWNER
#if 0 && ENABLE_LOCKOWNER
assert(l->__data.__owner == syscall(SYS_gettid));
#else
if(pthread_mutex_trylock(l) == EBUSY)

View file

@ -461,9 +461,10 @@ udp_multirecv_init( udp_multirecv_t *um, int packets, int psize )
void
udp_multirecv_free( udp_multirecv_t *um )
{
free(um->um_msg); um->um_msg = NULL;
free(um->um_iovec); um->um_iovec = NULL;
free(um->um_data); um->um_data = NULL;
free(um->um_msg); um->um_msg = NULL;
free(um->um_riovec); um->um_riovec = NULL;
free(um->um_iovec); um->um_iovec = NULL;
free(um->um_data); um->um_data = NULL;
um->um_psize = 0;
um->um_packets = 0;
}