summaryrefslogtreecommitdiffstats
path: root/text-utils/hexdump.c
diff options
context:
space:
mode:
authorKarel Zak2014-01-06 13:54:48 +0100
committerKarel Zak2014-01-06 13:54:48 +0100
commit2152af72894e95eb40aa2a1e5a5b3116cf7c659a (patch)
tree78920a0644cd2d76be8ee992a1e2d0fc0ea59526 /text-utils/hexdump.c
parenttests: libmount: skip tabfiles-py when pylibmount is disabled (diff)
downloadkernel-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.c3
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);