+
+
+/**
+ * cleanupcgi - free the memory allocated for our CGI parameters.
+ * @cgivars: The CGI parameter list to free.
+ *
+ * Frees up the elements of the CGI parameter array and then frees the
+ * array.
+ */
+void cleanupcgi(char **cgivars)
+{
+ int i;
+
+ if (cgivars != NULL) {
+ for (i = 0; cgivars[i] != NULL; i++) {
+ free(cgivars[i]);
+ cgivars[i] = NULL;
+ }
+ free(cgivars);
+ cgivars = NULL;
+ }
+
+ return;
+}