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:
parent
2152af7289
commit
917c3733f8
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue