fixed yet another very potential memleak;

v0.5.xx
Alexander Vdolainen 10 years ago
parent e857badffd
commit 412dbefe67

@ -218,7 +218,7 @@ int channel_close(chnl_t *chnl)
{ {
char *uuid_; char *uuid_;
usrtc_node_t *node = NULL; usrtc_node_t *node = NULL;
int r; int r = 0;
conn_t *co = chnl->connection; conn_t *co = chnl->connection;
conn_sys_t *ssys = co->ssys; conn_sys_t *ssys = co->ssys;
sxmsg_t *sms; sxmsg_t *sms;
@ -244,9 +244,10 @@ int channel_close(chnl_t *chnl)
uuid_ = __generate_uuid(); uuid_ = __generate_uuid();
pl = malloc(sizeof(sxpayload_t)); pl = malloc(sizeof(sxpayload_t));
if(!pl) { if(!pl || !uuid_) {
pthread_rwlock_unlock(&(chnl->msglock)); pthread_rwlock_unlock(&(chnl->msglock));
free(uuid_); if(pl) free(pl);
if(uuid_) free(uuid_);
return ENOMEM; return ENOMEM;
} }
if(__create_sys_msg(&sms, uuid_, chnl, pl)) { if(__create_sys_msg(&sms, uuid_, chnl, pl)) {

Loading…
Cancel
Save