summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2013-11-11 19:33:56 +0100
committerChanho Park <chanho61.park@samsung.com>2014-08-22 20:38:24 +0900
commit0fd27264475ccf69156fad88d07c2c229eb4c33b (patch)
tree41e06a8c649dbb798220013e4865272d3fb46cda
parentfa38aaf334ae958a0a4021dc181fd6c3cbf00c24 (diff)
downloadltrace-0fd27264475ccf69156fad88d07c2c229eb4c33b.tar.gz
ltrace-0fd27264475ccf69156fad88d07c2c229eb4c33b.tar.bz2
ltrace-0fd27264475ccf69156fad88d07c2c229eb4c33b.zip
In read_config_file.c, clone type info when unsharing it
-rw-r--r--read_config_file.c6
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. */