snits / rpms / trousers

Forked from rpms/trousers 6 years ago
Clone
fa2b354
diff -ur trousers-0.3.14/src/tspi/tsp_auth.c trousers-0.3.14-new/src/tspi/tsp_auth.c
fa2b354
--- trousers-0.3.14/src/tspi/tsp_auth.c	2014-07-23 12:42:45.000000000 -0700
fa2b354
+++ trousers-0.3.14-new/src/tspi/tsp_auth.c	2019-05-27 13:41:57.316000945 -0700
fa2b354
@@ -1221,7 +1221,7 @@
fa2b354
 	}
fa2b354
 
fa2b354
 	*handles = handle;
fa2b354
-    handles_track = handles;
fa2b354
+	handles_track = handles;
fa2b354
 
fa2b354
     // Since the call tree of this function can possibly alloc memory 
fa2b354
     // (check RPC_ExecuteTransport_TP function), its better to keep track of
fa2b354
@@ -1229,9 +1229,11 @@
fa2b354
 	result = obj_context_transport_execute(tspContext, TPM_ORD_Terminate_Handle, 0, NULL,
fa2b354
 					       NULL, &handlesLen, &handles, NULL, NULL, NULL, NULL);
fa2b354
 
fa2b354
-	free(handles);
fa2b354
-    handles = NULL;
fa2b354
-    free(handles_track);
fa2b354
+	if (handles != handles_track) {
fa2b354
+		free(handles);
fa2b354
+	}
fa2b354
+
fa2b354
+	free(handles_track);
fa2b354
 
fa2b354
 	return result;
fa2b354
 }