mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
r19679@catbus: nickm | 2008-05-11 20:56:12 -0400
Windows does not have alloca(). svn:r810
This commit is contained in:
parent
04366d5acc
commit
054159f59c
8
http.c
8
http.c
@ -1901,8 +1901,7 @@ evhttp_dispatch_callback(struct httpcbq *callbacks, struct evhttp_request *req)
|
||||
++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);
|
||||
|
||||
@ -1911,10 +1910,13 @@ evhttp_dispatch_callback(struct httpcbq *callbacks, struct evhttp_request *req)
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user