From: Simon Wilkinson Date: Tue, 15 Jun 2010 17:18:30 +0000 (+0100) Subject: bozo: Don't initialise variables unecessarily X-Git-Tag: upstream/1.8.0_pre1^2~3490 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=10264a523fd78e9cd22e41feda6c5eb6f75de784;p=packages%2Fo%2Fopenafs.git bozo: Don't initialise variables unecessarily Don't initialise variables to NULL 3 lines before we assign malloc results to them. Caught by clang-analyzer Change-Id: Ic0f2fc56fe6ce39411c4cd48ea0a0b955b3e0f19 Reviewed-on: http://gerrit.openafs.org/5080 Reviewed-by: Derrick Brashear Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- diff --git a/src/bozo/bosserver.c b/src/bozo/bosserver.c index b7a6bb7f4..d896a6eda 100644 --- a/src/bozo/bosserver.c +++ b/src/bozo/bosserver.c @@ -311,16 +311,15 @@ ReadBozoFile(char *aname) for (code = 0; code < MAXPARMS; code++) parms[code] = NULL; - instp = typep = notifier = NULL; tfile = (FILE *) 0; if (!aname) aname = (char *)bozo_fileName; tfile = fopen(aname, "r"); if (!tfile) return 0; /* -1 */ - instp = (char *)malloc(BOZO_BSSIZE); - typep = (char *)malloc(BOZO_BSSIZE); - notifier = notp = (char *)malloc(BOZO_BSSIZE); + instp = malloc(BOZO_BSSIZE); + typep = malloc(BOZO_BSSIZE); + notifier = notp = malloc(BOZO_BSSIZE); while (1) { /* ok, read lines giving parms and such from the file */ tp = fgets(tbuffer, sizeof(tbuffer), tfile);