From 8ae53f1d08462c4da1f7806ca82cdd721c937bca Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 14 Jun 2018 19:51:12 +0000 Subject: 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 --- usr.bin/file/magic-test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.bin/file') 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 @@ -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); } -- cgit v1.2.3