]> the.earth.li Git - onak.git/commitdiff
Fix keyd memory leak on error reading client provided search text
authorJonathan McDowell <noodles@earth.li>
Tue, 22 Jul 2014 11:53:40 +0000 (12:53 +0100)
committerJonathan McDowell <noodles@earth.li>
Tue, 22 Jul 2014 11:53:40 +0000 (12:53 +0100)
keyd.c

diff --git a/keyd.c b/keyd.c
index 2784257925a6f170ed7c8d8d172da26eafa77ad7..18e9ddca873a84e37c172408bb0ecdc20b611b19 100644 (file)
--- a/keyd.c
+++ b/keyd.c
@@ -344,6 +344,7 @@ static int sock_do(struct onak_dbctx *dbctx, int fd)
                                bytes = read(fd, search, count);
                                if (bytes != count) {
                                        ret = 1;
+                                       free(search);
                                        break;
                                }
                                search[count] = 0;