1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
From: Herve Rousseau <herve@moulticast.net>
Subject: Fixes a memleak (danchev@spnet.net)
diff -urNad getstream_20081204~/libhttp.c getstream_20081204/libhttp.c
--- getstream_20081204~/libhttp.c 2008-12-04 15:21:07.000000000 +0100
+++ getstream_20081204/libhttp.c 2009-08-23 18:05:47.000000000 +0200
@@ -556,11 +556,15 @@
hs->sin.sin_addr.s_addr=INADDR_ANY;
if (bind(hs->fd, (struct sockaddr *) &hs->sin,
- sizeof(struct sockaddr_in)))
+ sizeof(struct sockaddr_in))) {
+ free(hs);
return NULL;
+ }
- if (listen(hs->fd, 3))
+ if (listen(hs->fd, 3)) {
+ free(hs);
return NULL;
+ }
flags=fcntl(hs->fd, F_GETFL);
fcntl(hs->fd, F_GETFL, flags | O_NONBLOCK);
|