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>
This commit is contained in:
Andrew Vagin 2014-01-06 13:58:51 +01:00 committed by Karel Zak
parent 2152af7289
commit 917c3733f8
1 changed files with 5 additions and 1 deletions

View File

@ -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)