test session: tmp_name needs to be used twice
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 7 Feb 2012 03:09:11 +0000 (22:09 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 7 Feb 2012 03:09:11 +0000 (22:09 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tests/test_sessions.c

index 2adf233256eacfd57e568bd0cc3a60d0d744e5d7..5faf64f27f7d60ea27176a6da17ed4d1808a60b6 100644 (file)
@@ -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;
This page took 0.033622 seconds and 4 git commands to generate.