mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #2002 from OlegHahm/ccnl_malloc_all_over
ccn-lite: use always ccnl_malloc
This commit is contained in:
commit
9cf42d587f
@ -95,7 +95,7 @@ static int appserver_handle_interest(char *data, uint16_t datalen, uint16_t from
|
||||
char name[] = "/riot/appserver/test/0";
|
||||
appserver_create_prefix(name, prefix);
|
||||
|
||||
unsigned char *content_pkg = malloc(PAYLOAD_SIZE);
|
||||
unsigned char *content_pkg = ccnl_malloc(PAYLOAD_SIZE);
|
||||
if (!content_pkg) {
|
||||
puts("appserver_handle_interest: malloc failed");
|
||||
return 0;
|
||||
@ -154,7 +154,7 @@ static void riot_ccnl_appserver_register(void)
|
||||
snprintf(faceid, sizeof(faceid), "%" PRIkernel_pid, thread_getpid());
|
||||
char *type = "newMSGface";
|
||||
|
||||
unsigned char *mgnt_pkg = malloc(256);
|
||||
unsigned char *mgnt_pkg = ccnl_malloc(256);
|
||||
if (!mgnt_pkg) {
|
||||
puts("riot_ccnl_appserver_register: malloc failed");
|
||||
return;
|
||||
|
@ -79,7 +79,7 @@ int riot_send_msg(uint8_t *buf, uint16_t size, uint16_t to)
|
||||
DEBUGMSG(1, "this is a RIOT MSG based connection\n");
|
||||
DEBUGMSG(1, "size=%" PRIu16 " to=%" PRIu16 "\n", size, to);
|
||||
|
||||
uint8_t *buf2 = malloc(sizeof(riot_ccnl_msg_t) + size);
|
||||
uint8_t *buf2 = ccnl_malloc(sizeof(riot_ccnl_msg_t) + size);
|
||||
if (!buf2) {
|
||||
DEBUGMSG(1, " malloc failed...dorpping msg!\n");
|
||||
return 0;
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "ccnx.h"
|
||||
#include "ccnl.h"
|
||||
#include "ccnl-pdu.h"
|
||||
#include "ccnl-core.h"
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@ -39,13 +40,13 @@ mkNewFaceRequest(unsigned char *out, char *macsrc, char *ip4src,
|
||||
{
|
||||
int len = 0, len2, len3;
|
||||
|
||||
unsigned char *contentobj = malloc(500);
|
||||
unsigned char *contentobj = ccnl_malloc(500);
|
||||
if (!contentobj) {
|
||||
puts("mkNewFaceRequest: malloc failed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned char *faceinst = malloc(500);
|
||||
unsigned char *faceinst = ccnl_malloc(500);
|
||||
if (!faceinst) {
|
||||
free(contentobj);
|
||||
puts("mkNewFaceRequest: malloc failed");
|
||||
@ -117,13 +118,13 @@ mkPrefixregRequest(unsigned char *out, char reg, char *path, char *faceid)
|
||||
int len = 0, len2, len3;
|
||||
char *cp;
|
||||
|
||||
unsigned char *contentobj = malloc(500);
|
||||
unsigned char *contentobj = ccnl_malloc(500);
|
||||
if (!contentobj) {
|
||||
puts("mkNewFaceRequest: malloc failed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned char *fwdentry = malloc(500);
|
||||
unsigned char *fwdentry = ccnl_malloc(500);
|
||||
if (!fwdentry) {
|
||||
free(contentobj);
|
||||
puts("mkNewFaceRequest: malloc failed");
|
||||
|
@ -51,7 +51,7 @@ int ccnl_riot_client_get(kernel_pid_t relay_pid, char *name, char *reply_buf)
|
||||
memset(segment_string, 0, 16);
|
||||
snprintf(segment_string, 16, "%d", segment);
|
||||
prefix[i] = segment_string;
|
||||
unsigned char *interest_pkg = malloc(PAYLOAD_SIZE);
|
||||
unsigned char *interest_pkg = ccnl_malloc(PAYLOAD_SIZE);
|
||||
if (!interest_pkg) {
|
||||
puts("ccnl_riot_client_get: malloc failed");
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user