]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream commit
authorDamien Miller <djm@mindrot.org>
Fri, 15 Nov 2019 05:04:28 +0000 (16:04 +1100)
committerDamien Miller <djm@mindrot.org>
Fri, 15 Nov 2019 05:04:28 +0000 (16:04 +1100)
revision 1.46
date: 2015/12/28 22:08:18;  author: mmcc;  state: Exp;  lines: +5 -9;  commitid: 0uXuF2O13NH9q2e1;
Remove NULL-checks before free() and a few related dead assignments.

ok and valuable input from millert@

openbsd-compat/glob.c

index 7409b96e19934f5d473969717f604d7eb4ac4789..413dfc8cb5680a104603986127463c8625c46e38 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: glob.c,v 1.44 2015/09/14 16:09:13 tedu Exp $ */
+/*     $OpenBSD: glob.c,v 1.46 2015/12/28 22:08:18 mmcc Exp $ */
 /*
  * Copyright (c) 1989, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -820,14 +820,10 @@ globextend(const Char *path, glob_t *pglob, struct glob_lim *limitp,
                            pglob->gl_pathv && pglob->gl_pathv[i])
                                free(pglob->gl_statv[i]);
                }
-               if (pglob->gl_pathv) {
-                       free(pglob->gl_pathv);
-                       pglob->gl_pathv = NULL;
-               }
-               if (pglob->gl_statv) {
-                       free(pglob->gl_statv);
-                       pglob->gl_statv = NULL;
-               }
+               free(pglob->gl_pathv);
+               pglob->gl_pathv = NULL;
+               free(pglob->gl_statv);
+               pglob->gl_statv = NULL;
                return(GLOB_NOSPACE);
        }