diff options
author | Petr Machata <pmachata@redhat.com> | 2013-11-11 19:33:56 +0100 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2013-11-11 19:34:42 +0100 |
commit | 9521f9321bacb1eb27d4c152ecf69957dbbc0263 (patch) | |
tree | 41e06a8c649dbb798220013e4865272d3fb46cda | |
parent | 6e570e5bf8e0a9049cb1bad3ca4f82fae116c741 (diff) | |
download | ltrace-9521f9321bacb1eb27d4c152ecf69957dbbc0263.tar.gz |
In read_config_file.c, clone type info when unsharing it
-rw-r--r-- | read_config_file.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/read_config_file.c b/read_config_file.c index 991f121..ea3ab88 100644 --- a/read_config_file.c +++ b/read_config_file.c @@ -541,12 +541,12 @@ unshare_type_info(struct locus *loc, struct arg_type_info **infop, int *ownp) return 0; struct arg_type_info *ninfo = malloc(sizeof(*ninfo)); - if (ninfo == NULL) { + if (ninfo == NULL || type_clone(ninfo, *infop) < 0) { report_error(loc->filename, loc->line_no, "malloc: %s", strerror(errno)); + free(ninfo); return -1; } - *ninfo = **infop; *infop = ninfo; *ownp = 1; return 0; @@ -704,7 +704,7 @@ try_parse_kwd(char **str, const char *kwd) return -1; } -/* XXX extra_param and param_num are a kludge to get in +/* XXX EXTRA_PARAM and PARAM_NUM are a kludge to get in * backward-compatible support for "format" parameter type. The * latter is only valid if the former is non-NULL, which is only in * top-level context. */ |