From ec3714b3c74dcd0b2ddf824d9b92e68fa67090e9 Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Wed, 28 Jul 2010 08:35:10 +0200 Subject: [PATCH] bugfix --- main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index c4106e10..2d3b4a0b 100644 --- a/main.c +++ b/main.c @@ -605,7 +605,7 @@ resource_wellknown(coap_uri_t *uri, static unsigned char resources[] = ";ct=1;n=\"some large text to test buffer sizes ( marks its end)\"," ";ct=0,1,41;n=\"server's local time and date\"," - ";n=\"you can PUT things here\"" + ";n=\"you can PUT things here\"," ";n=\"POST files here or DELETE them when created\""; size_t maxlen = sizeof(resources) - 1; @@ -930,6 +930,9 @@ init_resources(coap_context_t *ctx) { write_file("filestorage",(unsigned char *)"initial text", 12); coap_add_resource( ctx, r ); + if ( !(r = coap_malloc( sizeof(coap_resource_t) ))) + return; + r->uri = coap_new_uri((const unsigned char *) "/data-sink", sizeof("/data-sink") - 1); r->mediatype = COAP_MEDIATYPE_APPLICATION_LINK_FORMAT;