From 10264a523fd78e9cd22e41feda6c5eb6f75de784 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Tue, 15 Jun 2010 18:18:30 +0100 Subject: [PATCH] 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 --- src/bozo/bosserver.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/bozo/bosserver.c b/src/bozo/bosserver.c index b7a6bb7..d896a6e 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); -- 1.9.4