From: Mathieu Desnoyers Date: Tue, 7 Feb 2012 03:09:11 +0000 (-0500) Subject: test session: tmp_name needs to be used twice X-Git-Tag: v2.0-pre20~15 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=e6dd5671bbf33f7f939fe48880d9c2ccb9030742;p=lttng-tools.git test session: tmp_name needs to be used twice Signed-off-by: Mathieu Desnoyers --- diff --git a/tests/test_sessions.c b/tests/test_sessions.c index 2adf23325..5faf64f27 100644 --- a/tests/test_sessions.c +++ b/tests/test_sessions.c @@ -241,7 +241,6 @@ static int two_session_same_name(void) int main(int argc, char **argv) { int ret, i; - char *tmp_name; struct ltt_session *iter, *tmp; srand(time(NULL)); @@ -313,7 +312,9 @@ int main(int argc, char **argv) printf("Creating %d sessions: ", MAX_SESSIONS); fflush(stdout); for (i = 0; i < MAX_SESSIONS; i++) { - ret = create_one_session(get_random_string(), PATH1); + char *tmp_name = get_random_string(); + + ret = create_one_session(tmp_name, PATH1); if (ret < 0) { printf("session %d (name: %s) creation failed\n", i, tmp_name); return -1;