Module Name: src
Committed By: mbalmer
Date: Thu Oct 17 07:49:06 UTC 2013
Modified Files:
src/libexec/httpd: lua-bozo.c
Log Message:
plug a memory leak
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/libexec/httpd/lua-bozo.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/libexec/httpd/lua-bozo.c
diff -u src/libexec/httpd/lua-bozo.c:1.2 src/libexec/httpd/lua-bozo.c:1.3
--- src/libexec/httpd/lua-bozo.c:1.2 Thu Oct 17 07:31:31 2013
+++ src/libexec/httpd/lua-bozo.c Thu Oct 17 07:49:06 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: lua-bozo.c,v 1.2 2013/10/17 07:31:31 mbalmer Exp $ */
+/* $NetBSD: lua-bozo.c,v 1.3 2013/10/17 07:49:06 mbalmer Exp $ */
/*
* Copyright (c) 2013 Marc Balmer <[email protected]>
@@ -254,8 +254,10 @@ lua_url_decode(lua_State *L, char *s)
for (p = v, q = val; *p; p++) {
switch (*p) {
case '%':
- if (*(p + 1) == '\0' || *(p + 2) == '\0')
+ if (*(p + 1) == '\0' || *(p + 2) == '\0') {
+ free(val);
return;
+ }
buf[0] = *++p;
buf[1] = *++p;
buf[2] = '\0';