diff options
author | Karel Zak | 2014-01-06 13:54:48 +0100 |
---|---|---|
committer | Karel Zak | 2014-01-06 13:54:48 +0100 |
commit | 2152af72894e95eb40aa2a1e5a5b3116cf7c659a (patch) | |
tree | 78920a0644cd2d76be8ee992a1e2d0fc0ea59526 /text-utils/hexdump.c | |
parent | tests: libmount: skip tabfiles-py when pylibmount is disabled (diff) | |
download | kernel-qcow2-util-linux-2152af72894e95eb40aa2a1e5a5b3116cf7c659a.tar.gz kernel-qcow2-util-linux-2152af72894e95eb40aa2a1e5a5b3116cf7c659a.tar.xz kernel-qcow2-util-linux-2152af72894e95eb40aa2a1e5a5b3116cf7c659a.zip |
hexdump: use xcalloc()
Reported-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'text-utils/hexdump.c')
-rw-r--r-- | text-utils/hexdump.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/text-utils/hexdump.c b/text-utils/hexdump.c index e9fca0294..d3d87dd57 100644 --- a/text-utils/hexdump.c +++ b/text-utils/hexdump.c @@ -50,6 +50,7 @@ #include "nls.h" #include "c.h" #include "strutils.h" +#include "xalloc.h" #include "closestream.h" void hex_free(struct hexdump *); @@ -167,7 +168,7 @@ int main(int argc, char **argv) struct hexdump_fs *tfs; char *c; - struct hexdump *hex = malloc (sizeof (struct hexdump)); + struct hexdump *hex = xcalloc(1, sizeof (struct hexdump)); hex->length = -1; INIT_LIST_HEAD(&hex->fshead); |