Browse Source

improve commit `variable.c: add strict error handling'

pre-master-46
rlar 14 years ago
parent
commit
451c121dd5
  1. 12
      src/frontend/variable.c

12
src/frontend/variable.c

@ -303,8 +303,7 @@ cp_setparse(wordlist *wl)
tfree(name); /*DG: cp_unquote Memory leak*/ tfree(name); /*DG: cp_unquote Memory leak*/
if (ft_stricterror) if (ft_stricterror)
controlled_exit(EXIT_BAD); controlled_exit(EXIT_BAD);
else
return (NULL);
return (NULL);
} }
val = wl->wl_word; val = wl->wl_word;
wl = wl->wl_next; wl = wl->wl_next;
@ -320,8 +319,7 @@ cp_setparse(wordlist *wl)
tfree(name); /*DG: cp_unquote Memory leak: free name before exiting*/ tfree(name); /*DG: cp_unquote Memory leak: free name before exiting*/
if (ft_stricterror) if (ft_stricterror)
controlled_exit(EXIT_BAD); controlled_exit(EXIT_BAD);
else
return (NULL);
return (NULL);
} else { } else {
val = wl->wl_word; val = wl->wl_word;
wl = wl->wl_next; wl = wl->wl_next;
@ -332,8 +330,7 @@ cp_setparse(wordlist *wl)
tfree(name); /*DG: cp_unquote Memory leak: free name befor exiting */ tfree(name); /*DG: cp_unquote Memory leak: free name befor exiting */
if (ft_stricterror) if (ft_stricterror)
controlled_exit(EXIT_BAD); controlled_exit(EXIT_BAD);
else
return (NULL);
return (NULL);
} }
/* val = cp_unquote(val); DG: bad old val is lost*/ /* val = cp_unquote(val); DG: bad old val is lost*/
@ -378,8 +375,7 @@ cp_setparse(wordlist *wl)
tfree(name); /* va: cp_unquote memory leak: free name before exiting */ tfree(name); /* va: cp_unquote memory leak: free name before exiting */
if (ft_stricterror) if (ft_stricterror)
controlled_exit(EXIT_BAD); controlled_exit(EXIT_BAD);
else
return (NULL);
return (NULL);
} }
vv = alloc(struct variable); vv = alloc(struct variable);

Loading…
Cancel
Save