Print this page
10075 make usr/src/tools smatch clean
*** 21,30 ****
--- 21,34 ----
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
+ * Copyright (c) 2018, Joyent, Inc.
+ */
+
+ /*
* Finds all unreferenced files in a source tree that do not match a list of
* permitted pathnames.
*/
#include <ctype.h>
*** 198,208 ****
char *hgcmd = NULL;
char *newline;
pnset_t *pnsetp;
char path[MAXPATHLEN];
! pnsetp = calloc(sizeof (pnset_t), 1);
if (pnsetp == NULL ||
asprintf(&hgcmd, "hg manifest -R %s", hgroot) == -1)
goto fail;
fp = popen(hgcmd, "r");
--- 202,212 ----
char *hgcmd = NULL;
char *newline;
pnset_t *pnsetp;
char path[MAXPATHLEN];
! pnsetp = calloc(1, sizeof (pnset_t));
if (pnsetp == NULL ||
asprintf(&hgcmd, "hg manifest -R %s", hgroot) == -1)
goto fail;
fp = popen(hgcmd, "r");
*** 240,250 ****
char *gitcmd = NULL;
char *newline;
pnset_t *pnsetp;
char path[MAXPATHLEN];
! pnsetp = calloc(sizeof (pnset_t), 1);
if (pnsetp == NULL ||
asprintf(&gitcmd, "git --git-dir=%s/.git ls-files", gitroot) == -1)
goto fail;
fp = popen(gitcmd, "r");
--- 244,254 ----
char *gitcmd = NULL;
char *newline;
pnset_t *pnsetp;
char path[MAXPATHLEN];
! pnsetp = calloc(1, sizeof (pnset_t));
if (pnsetp == NULL ||
asprintf(&gitcmd, "git --git-dir=%s/.git ls-files", gitroot) == -1)
goto fail;
fp = popen(gitcmd, "r");
*** 398,408 ****
char line[MAXPATHLEN];
char *newline;
pnset_t *pnsetp;
unsigned int i;
! pnsetp = calloc(sizeof (pnset_t), 1);
if (pnsetp == NULL)
return (NULL);
/*
* Add any exceptions from the file.
--- 402,412 ----
char line[MAXPATHLEN];
char *newline;
pnset_t *pnsetp;
unsigned int i;
! pnsetp = calloc(1, sizeof (pnset_t));
if (pnsetp == NULL)
return (NULL);
/*
* Add any exceptions from the file.