diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-09-23 02:39:28 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-09-23 16:28:27 +0200 |
commit | de3756ab9916551f3f4f1f360aee59aeed238b5b (patch) | |
tree | d3f8fc787262362d6edd63819fbab60cc6b0d285 /src/socket.c | |
parent | 4e240ab0c93f4d454b065eef7074132969ac6f16 (diff) |
llvm-analyze: fix some bugs found by llvm-analyze
Diffstat (limited to 'src/socket.c')
-rw-r--r-- | src/socket.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/socket.c b/src/socket.c index a1b451eba0..7ddf326a22 100644 --- a/src/socket.c +++ b/src/socket.c @@ -1962,6 +1962,12 @@ int socket_collect_fds(Socket *s, int **fds, unsigned *n_fds) { if (p->fd >= 0) rn_fds++; + if (rn_fds <= 0) { + *fds = NULL; + *n_fds = 0; + return 0; + } + if (!(rfds = new(int, rn_fds))) return -ENOMEM; |