|
From: <sv...@va...> - 2005-05-25 21:30:08
|
Author: njn
Date: 2005-05-25 22:30:05 +0100 (Wed, 25 May 2005)
New Revision: 3805
Modified:
trunk/coregrind/m_demangle/cp-demangle.c
Log:
Avoid confusing use of a pointer before checking it it's NULL. (The
code from the glibc demangler is buggy, but because we use a malloc()
that never returns NULL, this code is actually ok within Valgrind, albeit
strange. I changed it to avoid possible confusion.)
Reported by Madhu Kurup.
Modified: trunk/coregrind/m_demangle/cp-demangle.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_demangle/cp-demangle.c 2005-05-25 21:26:35 UTC (rev=
3804)
+++ trunk/coregrind/m_demangle/cp-demangle.c 2005-05-25 21:30:05 UTC (rev=
3805)
@@ -413,9 +413,9 @@
int length;
{
string_list_t s =3D (string_list_t) malloc (sizeof (struct string_list=
_def));
- s->caret_position =3D 0;
if (s =3D=3D NULL)
return NULL;
+ s->caret_position =3D 0;
if (!dyn_string_init ((dyn_string_t) s, length))
return NULL;
return s;
|