فهرست منبع

dispatcher(k): fix segfault if dispatcher cannot resolve hostnames

- applies if the dispatcher module cannot resolve hostnames during
  startup (and tries to shutdown)
- patch by Hugh Waite
Daniel-Constantin Mierla 14 سال پیش
والد
کامیت
cad2daebf2
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      modules_k/dispatcher/dispatch.c

+ 2 - 2
modules_k/dispatcher/dispatch.c

@@ -323,7 +323,6 @@ int add_dest2list(int id, str uri, int flags, int priority, str *attrs,
 	if (he==0)
 	{
 		LM_ERR("could not resolve %.*s\n", puri.host.len, puri.host.s);
-		pkg_free(hn);
 		goto err;
 	}
 	/* Free the hostname */
@@ -815,7 +814,8 @@ void destroy_list(int list_id)
    				dest->uri.s = NULL;
 	   		}
 		}
-		shm_free(sp->dlist);
+		if (sp->dlist != NULL)
+			shm_free(sp->dlist);
 		sp = sp->next;
 	}