diff options
| author | christos <christos@NetBSD.org> | 2013-11-13 21:46:22 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2013-11-13 21:46:22 +0000 |
| commit | cc8ee923f02088d5abf60b076b2b05a4935db820 (patch) | |
| tree | e2de6f21fe034fc346d0d095a38ab665f1200890 /libexec | |
| parent | 03b1fc47e57221b713a73c91b9c3f6bca58eafc5 (diff) | |
CID 1107545, 1107546: fix memory leak
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/httpd/lua-bozo.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libexec/httpd/lua-bozo.c b/libexec/httpd/lua-bozo.c index 2926eca8bfc..50f04385fac 100644 --- a/libexec/httpd/lua-bozo.c +++ b/libexec/httpd/lua-bozo.c @@ -1,4 +1,4 @@ -/* $NetBSD: lua-bozo.c,v 1.6 2013/11/13 21:44:29 christos Exp $ */ +/* $NetBSD: lua-bozo.c,v 1.7 2013/11/13 21:46:22 christos Exp $ */ /* * Copyright (c) 2013 Marc Balmer <marc@msys.ch> @@ -303,6 +303,7 @@ bozo_process_lua(bozo_httpreq_t *request) char *s, *query, *uri, *file, *command, *info, *content; const char *type, *clen; char *prefix, *handler, *p; + int rv = 0; if (!httpd->process_lua) return 0; @@ -435,18 +436,18 @@ bozo_process_lua(bozo_httpreq_t *request) printf("<br>Lua error: %s\n", lua_tostring(map->L, -1)); bozo_flush(httpd, stdout); - free(prefix); - free(uri); - free(info); - free(query); - return 1; + rv = 1; + goto out; } } +out: free(prefix); free(uri); free(info); free(query); - return 0; + free(command); + free(file); + return rv; } #endif /* NO_LUA_SUPPORT */ |
