From 853380368cc21946f0a44c4fc8da82b0549837e2 Mon Sep 17 00:00:00 2001 From: schwarze Date: Mon, 12 Oct 2015 21:09:08 +0000 Subject: [PATCH] Check the right pointer against NULL; fixing a pasto introduced in the previous commit; found by Svyatoslav Mishyn with cppcheck. --- usr.bin/mandoc/mandoc_aux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/mandoc/mandoc_aux.c b/usr.bin/mandoc/mandoc_aux.c index 7e7e19d5729..0536595bd72 100644 --- a/usr.bin/mandoc/mandoc_aux.c +++ b/usr.bin/mandoc/mandoc_aux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mandoc_aux.c,v 1.6 2015/10/11 21:06:59 schwarze Exp $ */ +/* $OpenBSD: mandoc_aux.c,v 1.7 2015/10/12 21:09:08 schwarze Exp $ */ /* * Copyright (c) 2009, 2011 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -89,7 +89,7 @@ mandoc_strdup(const char *ptr) char *p; p = strdup(ptr); - if (ptr == NULL) + if (p == NULL) err((int)MANDOCLEVEL_SYSERR, NULL); return p; } -- 2.20.1