bos: Don't set up the conenction twice in AddKey
authorSimon Wilkinson <sxw@your-file-system.com>
Thu, 21 Feb 2013 21:29:56 +0000 (21:29 +0000)
committerDerrick Brashear <shadow@your-file-system.com>
Sun, 24 Feb 2013 13:22:26 +0000 (05:22 -0800)
AddKey calls GetConn twice - once at the start of the function,
and then again immediately before calling BOZO_AddKey. This leaks
a connection...

Caught by clang-analyzer

Change-Id: I5c593de56e7f61fb21b973a34bea1a5b4f4a3177
Reviewed-on: http://gerrit.openafs.org/9230
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

src/bozo/bos.c

index 24b9dc3..34c4fd3 100644 (file)
@@ -841,7 +841,6 @@ AddKey(struct cmd_syndesc *as, void *arock)
 */
        ka_StringToKey(buf, tcell, &tkey);
     }
-    tconn = GetConn(as, 1);
     code = BOZO_AddKey(tconn, temp, ktc_to_bozoptr(&tkey));
     if (code) {
        printf("bos: failed to set key %d (%s)\n", temp, em(code));