summaryrefslogtreecommitdiffstats
path: root/text-utils/hexdump.c
diff options
context:
space:
mode:
authorAndrew Vagin2014-01-06 13:58:51 +0100
committerKarel Zak2014-01-06 14:01:04 +0100
commit917c3733f8f200097f10f779d1756d2913f35ab8 (patch)
tree24b339d799609e952517fd5968aa86d3e29311d3 /text-utils/hexdump.c
parenthexdump: use xcalloc() (diff)
downloadkernel-qcow2-util-linux-917c3733f8f200097f10f779d1756d2913f35ab8.tar.gz
kernel-qcow2-util-linux-917c3733f8f200097f10f779d1756d2913f35ab8.tar.xz
kernel-qcow2-util-linux-917c3733f8f200097f10f779d1756d2913f35ab8.zip
hexdump: don't access hex after freeing it
[kzak@redhat.com: - remove unnecessary code] Signed-off-by: Andrew 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.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/text-utils/hexdump.c b/text-utils/hexdump.c
index d3d87dd57..ac7778229 100644
--- a/text-utils/hexdump.c
+++ b/text-utils/hexdump.c
@@ -166,6 +166,7 @@ int main(int argc, char **argv)
{
struct list_head *p;
struct hexdump_fs *tfs;
+ int ret;
char *c;
struct hexdump *hex = xcalloc(1, sizeof (struct hexdump));
@@ -197,8 +198,11 @@ int main(int argc, char **argv)
next(argv, hex);
display(hex);
+
+ ret = hex->exitval;
hex_free(hex);
- return hex->exitval;
+
+ return ret;
}
void hex_free(struct hexdump *hex)