Tutorial code fix

Accessed elements of names[] after freeing them in the first example.

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Jim Ingram 2009-12-07 14:41:18 -06:00 committed by Julien Danjou
parent a470579ba2
commit 1e746fd89a

View File

@ -471,8 +471,6 @@ main ()
diff = end - start;
/* free var */
for (i = 0; i &lt; count; ++i)
free (names[i]);
free (atoms);
free (cs);
@ -494,6 +492,8 @@ main ()
printf ("ratio : %f\n", diff_x / diff);
free (atoms_x);
for (i = 0; i &lt; count; ++i)
free (names[i]);
free (names);
XCloseDisplay (disp);