Don't return a freed pointer in allocate_ccache()
authorAsanka Herath <asanka@secure-endpoints.com>
Thu, 2 Sep 2010 21:17:56 +0000 (17:17 -0400)
committerAsanka C. Herath <asanka@secure-endpoints.com>
Tue, 14 Sep 2010 12:04:17 +0000 (08:04 -0400)
lib/krb5/cache.c

index 4c2cf3bce423b4dc9c1a5f9405ded6f45890212b..d3926004b4da3d7a6b3935845d67a7159e8d7644 100644 (file)
@@ -206,8 +206,10 @@ allocate_ccache (krb5_context context,
     }
 
     ret = (*id)->ops->resolve(context, id, residual);
-    if(ret)
+    if(ret) {
        free(*id);
+        *id = NULL;
+    }
 
 #ifdef KRB5_USE_PATH_TOKENS
     if (exp_residual)