rem: np->pattern = (char *) shm_malloc(strlen(pattern));
add: np->pattern = (char *) shm_malloc(strlen(pattern)+1);
context: int hash_table_insert(struct trusted_list** hash_table, char* src_ip, char* proto, char* pattern){	struct trusted_list *np;	unsigned int hash_val;	np = (struct trusted_list *) shm_malloc(sizeof(*np));	if (np == NULL) {		LOG(L_CRIT, "hash_table_insert(): Cannot allocate memory for table entry\n");		return -1;	}	np->src_ip.len = strlen(src_ip);	np->src_ip.s = (char *) shm_malloc(np->src_ip.len);	if (np->src_ip.s == NULL) {		LOG(L_CRIT, "hash_table_insert(): Cannot allocate memory for src_ip string\n");		return -1;	}	(void) strncpy(np->src_ip.s, src_ip, np->src_ip.len);	if (strcmp(proto, "any") == 0) {		np->proto = PROTO_NONE;	} else if (strcmp(proto, "udp") == 0) {		np->proto = PROTO_UDP;	} else if (strcmp(proto, "tcp") == 0) {		np->proto = PROTO_TCP;	} else if (strcmp(proto, "tls") == 0) {		np->proto = PROTO_TLS;	} else if (strcmp(proto, "sctp") == 0) {		np->proto = PROTO_SCTP;	} else {		LOG(L_CRIT, "hash_table_insert(): Unknown protocol\n");		return -1;	}			np->pattern = (char *) shm_malloc(strlen(pattern));	if (np->pattern == NULL) {		LOG(L_CRIT, "hash_table_insert(): Cannot allocate memory for pattern string\n");		return -1;	}	(void) strcpy(np->pattern, pattern);	hash_val = hash(&(np->src_ip));	np->next = hash_table[hash_val];	hash_table[hash_val] = np;	return 1;}