summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Kerola2012-03-05 21:39:57 +0100
committerSami Kerola2012-03-18 14:29:38 +0100
commitfd2e8c693e02c0b8ca0503e68bc9fe09dea4f0b2 (patch)
tree5567495b8d93086de6cf83049af32e97df2c0cb3
parenttools: add asprintf to checkxalloc script (diff)
downloadkernel-qcow2-util-linux-fd2e8c693e02c0b8ca0503e68bc9fe09dea4f0b2.tar.gz
kernel-qcow2-util-linux-fd2e8c693e02c0b8ca0503e68bc9fe09dea4f0b2.tar.xz
kernel-qcow2-util-linux-fd2e8c693e02c0b8ca0503e68bc9fe09dea4f0b2.zip
lslocks: use xasprintf for safe allocation
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
-rw-r--r--misc-utils/lslocks.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/misc-utils/lslocks.c b/misc-utils/lslocks.c
index dad3d0bcd..0abc2a4bf 100644
--- a/misc-utils/lslocks.c
+++ b/misc-utils/lslocks.c
@@ -399,31 +399,31 @@ static void add_tt_line(struct tt *tt, struct lock *l)
switch (get_column_id(i)) {
case COL_SRC:
- rc = asprintf(&str, "%s", l->cmdname ? l->cmdname : notfnd);
+ rc = xasprintf(&str, "%s", l->cmdname ? l->cmdname : notfnd);
break;
case COL_PID:
- rc = asprintf(&str, "%d", l->pid);
+ rc = xasprintf(&str, "%d", l->pid);
break;
case COL_TYPE:
- rc = asprintf(&str, "%s", l->type);
+ rc = xasprintf(&str, "%s", l->type);
break;
case COL_SIZE:
- rc = asprintf(&str, "%s", l->size);
+ rc = xasprintf(&str, "%s", l->size);
break;
case COL_MODE:
- rc = asprintf(&str, "%s", l->mode);
+ rc = xasprintf(&str, "%s", l->mode);
break;
case COL_M:
- rc = asprintf(&str, "%d", l->mandatory);
+ rc = xasprintf(&str, "%d", l->mandatory);
break;
case COL_START:
- rc = asprintf(&str, "%ld", l->start);
+ rc = xasprintf(&str, "%ld", l->start);
break;
case COL_END:
- rc = asprintf(&str, "%ld", l->end);
+ rc = xasprintf(&str, "%ld", l->end);
break;
case COL_PATH:
- rc = asprintf(&str, "%s", l->path ? l->path : notfnd);
+ rc = xasprintf(&str, "%s", l->path ? l->path : notfnd);
break;
default:
break;