From: schwarze Date: Mon, 12 Oct 2015 21:09:08 +0000 (+0000) Subject: Check the right pointer against NULL; X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=853380368cc21946f0a44c4fc8da82b0549837e2;p=openbsd Check the right pointer against NULL; fixing a pasto introduced in the previous commit; found by Svyatoslav Mishyn with cppcheck. --- 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; }