Windows does not have alloca().
svn:r810
++p;
offset = (size_t)(p - req->uri);
- /* allocate the rewritten version on the stack */
- if ((translated = alloca(offset + 1)) == NULL)
+ if ((translated = mm_malloc(offset + 1)) == NULL)
return (NULL);
offset = evhttp_decode_uri_internal(req->uri, offset, translated);
res = ((strncmp(cb->what, translated, offset) == 0) &&
(cb->what[offset] == '\0'));
- if (res)
+ if (res) {
+ mm_free(translated);
return (cb);
+ }
}
+ mm_free(translated);
return (NULL);
}