diff options
author | Mansour Moufid <mansourmoufid@gmail.com> | 2011-05-27 18:40:31 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-06-08 16:46:21 -0400 |
commit | 446cc7a0a1160f9214bef3b2d5140c2ddca9cee0 (patch) | |
tree | 8304ec14f63ad1d0332071359ca57207c251ccea /http.c | |
parent | 09fe97da3b0dcdb6ee172ff8e4f710e0baad2d1c (diff) | |
download | libevent-446cc7a0a1160f9214bef3b2d5140c2ddca9cee0.tar.gz |
Check if the `evhttp_new_object' function in `http.c' returns NULL.
Diffstat (limited to 'http.c')
-rw-r--r-- | http.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -3203,8 +3203,11 @@ evhttp_new_object(void) struct evhttp * evhttp_new(struct event_base *base) { - struct evhttp *http = evhttp_new_object(); + struct evhttp *http = NULL; + http = evhttp_new_object(); + if (http == NULL) + return (NULL); http->base = base; return (http); @@ -3217,8 +3220,11 @@ evhttp_new(struct event_base *base) struct evhttp * evhttp_start(const char *address, unsigned short port) { - struct evhttp *http = evhttp_new_object(); + struct evhttp *http = NULL; + http = evhttp_new_object(); + if (http == NULL) + return (NULL); if (evhttp_bind_socket(http, address, port) == -1) { mm_free(http); return (NULL); |