nat_traversal: proper size for realloc
authorDaniel-Constantin Mierla <miconda@gmail.com>
Mon, 24 Feb 2014 20:32:45 +0000 (21:32 +0100)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Mon, 24 Feb 2014 20:32:45 +0000 (21:32 +0100)
- reported by Venky

modules/nat_traversal/nat_traversal.c

index 3368689..92ddd4c 100644 (file)
@@ -685,7 +685,7 @@ Dialog_Param_add_candidate(Dialog_Param *param, char *candidate)
     if (param->callee_candidates.count == param->callee_candidates.size) {
         new_size = param->callee_candidates.size + URI_LIST_RESIZE_INCREMENT;
         LM_DBG("growing callee_candidates list size from %d to %d entries\n", param->callee_candidates.size, new_size);
-        new_uri = shm_realloc(param->callee_candidates.uri, new_size);
+        new_uri = shm_realloc(param->callee_candidates.uri, new_size * sizeof(char*));
         if (!new_uri) {
             LM_ERR("failed to grow callee_candidates uri list\n");
             return False;