Revision 5a3fd26a

View differences:

blacklist.c
34 34
		bl2 = (struct black_list*) malloc(sizeof(struct black_list));
35 35
		bl2->blp.insertion_time = current_time.tv_sec + current_time.tv_usec*1e-6;
36 36
		bl2->blp.node_addr = NULL;
37
		bl2->blp.node_addr = (char*) malloc(strlen(node_addr + 1));
37
		bl2->blp.node_addr = (char*) malloc(strlen(node_addr));
38 38
		strcpy(bl2->blp.node_addr, node_addr);
39 39
		bl->previous = bl2;
40 40
		bl2->next = bl;
......
47 47
		bl->blp.insertion_time = current_time.tv_sec + current_time.tv_usec*1e-6;
48 48
		dprintf("BLACKLIST: adding peer %s to the list, insertion_time %f (empty)\n",  node_addr,(current_time.tv_sec + current_time.tv_usec*1e-6));
49 49
                bl->blp.node_addr = NULL;
50
                bl->blp.node_addr = (char*) malloc(strlen(node_addr + 1));
50
                bl->blp.node_addr = (char*) malloc(strlen(node_addr));
51 51
		strcpy(bl->blp.node_addr, node_addr);
52 52
		bl->next = NULL;
53 53
		bl->previous = NULL;

Also available in: Unified diff