mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-13 06:16:10 -04: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;
|
++p;
|
||||||
offset = (size_t)(p - req->uri);
|
offset = (size_t)(p - req->uri);
|
||||||
|
|
||||||
/* allocate the rewritten version on the stack */
|
if ((translated = mm_malloc(offset + 1)) == NULL)
|
||||||
if ((translated = alloca(offset + 1)) == NULL)
|
|
||||||
return (NULL);
|
return (NULL);
|
||||||
offset = evhttp_decode_uri_internal(req->uri, offset, translated);
|
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) &&
|
res = ((strncmp(cb->what, translated, offset) == 0) &&
|
||||||
(cb->what[offset] == '\0'));
|
(cb->what[offset] == '\0'));
|
||||||
|
|
||||||
if (res)
|
if (res) {
|
||||||
|
mm_free(translated);
|
||||||
return (cb);
|
return (cb);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mm_free(translated);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user