diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2018-06-14 19:51:12 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2018-06-14 19:51:12 +0000 |
commit | 8ae53f1d08462c4da1f7806ca82cdd721c937bca (patch) | |
tree | 8809bd9e01c3da6c80c7eecdd35c4d9941f91957 /usr.bin/file | |
parent | 94fb5d8a7529fc1d18d28897ecbfdfa11b8e8cb2 (diff) |
Return from magic_test does not need to be copied because the caller
will do so anyway and it was just being leaked. ok brynet deraadt
Diffstat (limited to 'usr.bin/file')
-rw-r--r-- | usr.bin/file/magic-test.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/file/magic-test.c b/usr.bin/file/magic-test.c index 88baab00269..037d3d19581 100644 --- a/usr.bin/file/magic-test.c +++ b/usr.bin/file/magic-test.c @@ -1,4 +1,4 @@ -/* $OpenBSD: magic-test.c,v 1.25 2017/04/18 14:16:48 nicm Exp $ */ +/* $OpenBSD: magic-test.c,v 1.26 2018/06/14 19:51:11 nicm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org> @@ -1404,10 +1404,10 @@ magic_test(struct magic *m, const void *base, size_t size, int flags) if (*ms.out != '\0') { if (flags & MAGIC_TEST_MIME) { if (ms.mimetype != NULL) - return (xstrdup(ms.mimetype)); + return (ms.mimetype); return (NULL); } - return (xstrdup(ms.out)); + return (ms.out); } return (NULL); } |