google-code-export / libfov

Automatically exported from code.google.com/p/libfov
MIT License
2 stars 3 forks source link

Comparison of uninitialized variable #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Vagrind reported this:
==29143== Conditional jump or move depends on uninitialised value(s)
==29143== at 0x80C21D0: fov_settings_free (fov.c:163)

I noticed that the the fov_settings_free() is comparing the value of
settings->heights, and it has not been initialized in the
fov_settings_init() to it causes Valgrind to report it. Simple fix is to
initialize it to NULL in the fov_settings_init():

--- fov.c (revision ??)
+++ fov.c (working copy)
@@ -81,6 +81,7 @@
settings->opaque_apply = FOV_OPAQUE_APPLY;
settings->opaque = NULL;
settings->apply = NULL;
+ settings->heights = NULL;
settings->numheights = 0;
}

This bug is not visible to users, as on the same line settings->numheights
value is compared, which makes the function work correctly. But it would be
nice to fix this to cleanup the Valgrind output to see the real problems.

Original issue reported on code.google.com by blue.p...@gmail.com on 9 Jun 2008 at 12:32

GoogleCodeExporter commented 9 years ago

Original comment by blue.p...@gmail.com on 9 Jun 2008 at 12:34

GoogleCodeExporter commented 9 years ago
From
http://sourceforge.net/tracker/index.php?func=detail&aid=1923849&group_id=159968
&atid=813957

Original comment by blue.p...@gmail.com on 9 Jun 2008 at 6:19

GoogleCodeExporter commented 9 years ago

Original comment by blue.p...@gmail.com on 9 Jun 2008 at 6:20

GoogleCodeExporter commented 9 years ago

Original comment by blue.p...@gmail.com on 9 Jun 2008 at 6:22