-const char cgi_rcs[] = "$Id: cgi.c,v 1.158 2012/12/07 12:45:20 fabiankeil Exp $";
+const char cgi_rcs[] = "$Id: cgi.c,v 1.159 2014/10/18 11:31:25 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgi.c,v $
if (*query_args_start == '/')
{
*query_args_start++ = '\0';
- if ((param_list = new_map()))
- {
- 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();
- }
+ param_list = new_map();
+ err = map(param_list, "file", 1, url_decode(query_args_start), 0);
+ if (JB_ERR_OK != err) {
+ free(param_list);
+ free(path_copy);
+ return cgi_error_memory();
}
}
else
}
vector = malloc_or_die(max_segments * sizeof(char *));
- if (NULL == (cgi_params = new_map()))
- {
- freez(vector);
- return NULL;
- }
+ cgi_params = new_map();
/*
* IE 5 does, of course, violate RFC 2316 Sect 4.1 and sends
assert(csp);
exports = new_map();
- if (exports == NULL)
- {
- return NULL;
- }
if (csp->config->hostname)
{
-const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.85 2014/10/18 11:29:22 fabiankeil Exp $";
+const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.86 2014/10/18 11:29:48 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgiedit.c,v $
{
if (!strncmp(b->url->spec, "standard.", 9) && *(b->url->spec + 9) != '\0')
{
- if (err || (NULL == (section_exports = new_map())))
+ if (err)
{
freez(buttons);
free(section_template);
return JB_ERR_MEMORY;
}
+ section_exports = new_map();
err = map(section_exports, "button-name", 1, b->url->spec + 9, 1);
if (err || (NULL == (s = strdup(section_template))))
while ((cur_line != NULL) && (cur_line->type == FILE_LINE_ACTION))
{
- if (NULL == (section_exports = new_map()))
- {
- free(sections);
- free(section_template);
- free(url_template);
- edit_free_file(file);
- free_map(exports);
- return JB_ERR_MEMORY;
- }
+ section_exports = new_map();
snprintf(buf, sizeof(buf), "%u", line_number);
err = map(section_exports, "s", 1, buf, 1);
while ((cur_line != NULL) && (cur_line->type == FILE_LINE_URL))
{
- if (NULL == (url_exports = new_map()))
- {
- free(urls);
- free(sections);
- free(section_template);
- free(url_template);
- edit_free_file(file);
- free_map(exports);
- free_map(section_exports);
- return JB_ERR_MEMORY;
- }
+ url_exports = new_map();
snprintf(buf, sizeof(buf), "%u", line_number);
err = map(url_exports, "p", 1, buf, 1);
-const char list_rcs[] = "$Id: list.c,v 1.28 2012/03/09 16:23:50 fabiankeil Exp $";
+const char list_rcs[] = "$Id: list.c,v 1.29 2012/03/09 17:55:50 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/list.c,v $
* Function : new_map
*
* Description : Create a new, empty map.
+ * Causes program exit if the memory allocation fails.
*
* Parameters : N/A
*
- * Returns : A new, empty map, or NULL if out of memory.
+ * Returns : A new, empty map
*
*********************************************************************/
struct map *new_map(void)
{
- return (struct map *) zalloc(sizeof(struct map));
+ struct map *empty_map = zalloc(sizeof(struct map));
+
+ if (NULL == empty_map)
+ {
+ exit(1);
+ }
+
+ return empty_map;
+
}