Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 378197) +++ channels/chan_sip.c (working copy) @@ -14680,14 +14680,17 @@ /* 1st we pass through all the hops in any Record-Route headers */ for (;;) { /* Each Record-Route header */ - char rr_copy[256]; + char *rr_copy; char *rr_copy_ptr; char *rr_iter; + int rr_len; rr = __get_header(req, "Record-Route", &start); if (*rr == '\0') { break; } - ast_copy_string(rr_copy, rr, sizeof(rr_copy)); + rr_len = strlen(rr) + 1; + rr_copy = ast_malloc(rr_len); + ast_copy_string(rr_copy, rr, rr_len); rr_copy_ptr = rr_copy; while ((rr_iter = strsep(&rr_copy_ptr, ","))) { /* Each route entry */ char *uri = get_in_brackets(rr_iter); @@ -14718,6 +14721,7 @@ } } } + ast_free(rr_copy); } /* Only append the contact if we are dealing with a strict router */