Merge pull request #65 from terual/master

Added missing free()s
This commit is contained in:
Andreas Öman 2012-03-07 06:15:50 -08:00
commit 3c341d8b44
2 changed files with 7 additions and 2 deletions

View file

@ -452,8 +452,10 @@ cwc_send_msg(cwc_t *cwc, const uint8_t *msg, size_t len, int sid, int enq)
uint8_t *buf = cm->cm_data;
int seq, n;
if(len + 12 > CWS_NETMSGSIZE)
if(len + 12 > CWS_NETMSGSIZE) {
free(cm);
return -1;
}
memset(buf, 0, 12);
memcpy(buf + 12, msg, len);
@ -469,6 +471,7 @@ cwc_send_msg(cwc_t *cwc, const uint8_t *msg, size_t len, int sid, int enq)
if((len = des_encrypt(buf, len, cwc)) < 0) {
free(buf);
free(cm);
return -1;
}

View file

@ -226,8 +226,10 @@ pvr_generate_filename(dvr_entry_t *de)
/* */
if(makedirs(path) != 0)
if(makedirs(path) != 0) {
free(filename);
return -1;
}
/* Construct final name */