[lttng-dev] [PATCH] create.c : Fix memory leak

Thibault, Daniel Daniel.Thibault at drdc-rddc.gc.ca
Tue Jan 31 14:32:56 EST 2012


>From e85aacb4c42fc522fce58971abc85ed2fed70123 Tue, 31 Jan 2012 14:31:56 -0500
From: Daniel U. Thibault <daniel.thibault at drdc-rddc.gc.ca>
Date: Tue, 31 Jan 2012 14:31:47 -0500
Subject: [PATCH] create.c : Fix memory leak

Signed-off-by: Daniel U. Thibault <daniel.thibault at drdc-rddc.gc.ca>

diff --git a/src/bin/lttng/commands/create.c b/src/bin/lttng/commands/create.c
index 99e5daa..e521024 100644
--- a/src/bin/lttng/commands/create.c
+++ b/src/bin/lttng/commands/create.c
@@ -132,6 +132,10 @@
 	ret = CMD_SUCCESS;
 
 error:
+	if (opt_session_name == NULL) {
+		free(session_name);
+	}
+
 	if (alloc_path) {
 		free(alloc_path);
 	}
------------------------------

Daniel U. Thibault
R & D pour la défense Canada - Valcartier (RDDC Valcartier) / Defence R&D Canada - Valcartier (DRDC Valcartier)
Système de systèmes (SdS) / System of Systems (SoS)
Solutions informatiques et expérimentations (SIE) / Computing Solutions and Experimentations (CSE)
2459 Boul. Pie XI Nord
Québec, QC  G3J 1X5
CANADA
Vox : (418) 844-4000 x4245
Fax : (418) 844-4538
NAC: 918V QSDJ
Gouvernement du Canada / Government of Canada
<http://www.valcartier.drdc-rddc.gc.ca/>



More information about the lttng-dev mailing list