usd: Can't call usd_FileStandard* with NULL
authorSimon Wilkinson <sxw@your-file-system.com>
Tue, 12 Feb 2013 14:07:10 +0000 (14:07 +0000)
committerDerrick Brashear <shadow@your-file-system.com>
Wed, 20 Feb 2013 20:30:52 +0000 (12:30 -0800)
It doesn't make sense to call usd_FileStandard{Input,Output} with
a NULL usd_handle_t (and doing so would crash later in the
function), so don't check for attempts to do so.

Caught by clang-analyzer

Change-Id: I03c0b627056108fe0d6f78d8028323cc4ed74758
Reviewed-on: http://gerrit.openafs.org/9151
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/usd/usd_file.c

index f66df08..06c6a4c 100644 (file)
@@ -392,9 +392,6 @@ usd_FileStandardInput(usd_handle_t * usdP)
 {
     usd_handle_t usd;
 
-    if (usdP)
-       *usdP = NULL;
-
     usd = calloc(1, sizeof(*usd));
     usd->handle = (void *)((unsigned long)0);
     usd->read = usd_FileRead;
@@ -420,9 +417,6 @@ usd_FileStandardOutput(usd_handle_t * usdP)
 {
     usd_handle_t usd;
 
-    if (usdP)
-       *usdP = NULL;
-
     usd = calloc(1, sizeof(*usd));
     usd->handle = (void *)((unsigned long)1);
     usd->read = usd_FileRead;