Free Some Unfreed Memory

This commit is contained in:
akmhoque committed 2013-03-15 01:20:16 -05:00
1 parent 1162d85394
commit 284056b9fb
3 files changed
+10 -2

No files matched your search

+2
View File
@@ -147,10 +147,12 @@ sign_content_with_user_defined_keystore(struct ccn_charbuf *content_name,
return -1;
}
ccn_keystore_destroy(&keystore);
ccn_charbuf_destroy(&sp.template_ccnb);
ccn_charbuf_destroy(&keyid);
ccn_charbuf_destroy(&keyname);
ccn_charbuf_destroy(&pubid_out);
free(baseuri);
return 0;
}
+2
View File
@@ -249,6 +249,8 @@ get_orig_router_from_key_name(struct ccn_charbuf *name, int more, int type)
memcpy(router,ccn_charbuf_as_string(temp1),
strlen(ccn_charbuf_as_string(temp1)));
router[strlen(router)]='\0';
ccn_charbuf_destroy(&temp1);
ccn_charbuf_destroy(&orig_router);
}
else{
ccn_indexbuf_destroy(&name_comps);
+6 -2
View File
@@ -80,7 +80,7 @@ get_nbr(struct name_prefix *nbr,struct ccn_closure *selfp,
}
nbr->name=(char *)malloc(strlen(neighbor)+1);
nbr->name=(char *)calloc(strlen(neighbor)+1,sizeof(char));
memcpy(nbr->name,neighbor,strlen(neighbor)+1);
nbr->length=strlen(neighbor)+1;
@@ -359,6 +359,7 @@ process_incoming_interest_info(struct ccn_closure *selfp, struct ccn_upcall_info
//ccn_charbuf_destroy(&sp.template_ccnb);
//ccn_charbuf_destroy(&pubid);
//ccn_charbuf_destroy(&pubkey);
ccn_charbuf_destroy(&resultbuf);
}
//ccn_charbuf_destroy(&data);
@@ -670,7 +671,10 @@ process_incoming_timed_out_interest_info(struct ccn_closure* selfp, struct
}
}
free(nbr);
if ( nbr->name != NULL )
free(nbr->name);
if ( nbr != NULL )
free(nbr);
}