summaryrefslogtreecommitdiffstats
path: root/misc-utils/findmnt.c
diff options
context:
space:
mode:
authorDave Reisner2012-03-20 09:44:40 +0100
committerKarel Zak2012-03-20 09:44:40 +0100
commit99d618c0eb5fc7dc0d4bb39df3ce5d680ab5b8e2 (patch)
tree3b0303acde572267b7ef28eddf8d0357de007585 /misc-utils/findmnt.c
parentfindmnt: add -P, --pairs to the man page (diff)
downloadkernel-qcow2-util-linux-99d618c0eb5fc7dc0d4bb39df3ce5d680ab5b8e2.tar.gz
kernel-qcow2-util-linux-99d618c0eb5fc7dc0d4bb39df3ce5d680ab5b8e2.tar.xz
kernel-qcow2-util-linux-99d618c0eb5fc7dc0d4bb39df3ce5d680ab5b8e2.zip
checkxalloc: nudge regex, fix newfound instances
Using the -w flag with grep actually fought against us here, and hid some instances where xalloc functions weren't used. Discard it in favor of an explicit word boundary as a prefix to the function name, and extend our requirements on the trailing side of the pattern. This also fixes the few new instances that were overlooked because of the regex's deficiency. [kzak@redhat.com: - fix also newfound in findmnt - remove unnecessary checks after xallocs] Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/findmnt.c')
-rw-r--r--misc-utils/findmnt.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c
index 2df79a4cb..f80038144 100644
--- a/misc-utils/findmnt.c
+++ b/misc-utils/findmnt.c
@@ -497,13 +497,7 @@ static int parser_errcb(struct libmnt_table *tb __attribute__ ((__unused__)),
static char **append_tabfile(char **files, int *nfiles, char *filename)
{
- void *tmp = realloc(files, sizeof(char *) * (*nfiles + 1));
-
- if (!tmp) {
- free(files);
- return NULL;
- }
- files = tmp;
+ files = xrealloc(files, sizeof(char *) * (*nfiles + 1));
files[(*nfiles)++] = filename;
return files;
}