Add missing return check in dispatch_known_cgi()
[privoxy.git] / cgi.c
diff --git a/cgi.c b/cgi.c
index f81443e..4f7710d 100644 (file)
--- a/cgi.c
+++ b/cgi.c
@@ -1,4 +1,4 @@
-const char cgi_rcs[] = "$Id: cgi.c,v 1.157 2012/11/09 10:47:42 fabiankeil Exp $";
+const char cgi_rcs[] = "$Id: cgi.c,v 1.158 2012/12/07 12:45:20 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/cgi.c,v $
@@ -497,7 +497,12 @@ static struct http_response *dispatch_known_cgi(struct client_state * csp,
       *query_args_start++ = '\0';
       if ((param_list = new_map()))
       {
-         map(param_list, "file", 1, url_decode(query_args_start), 0);
+         err = map(param_list, "file", 1, url_decode(query_args_start), 0);
+         if (JB_ERR_OK != err) {
+            free(path_copy);
+            free(param_list);
+            return cgi_error_memory();
+         }
       }
    }
    else