test whether pointer is non-NULL before using it, not after, in wxDoFindStringInList (this was probably harmless though)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45144 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -272,11 +272,10 @@ int wxDoFindStringInList(Widget w, const wxString& s)
|
|||||||
bool success = XmListGetMatchPos (w, str(),
|
bool success = XmListGetMatchPos (w, str(),
|
||||||
&positions, &no_positions);
|
&positions, &no_positions);
|
||||||
|
|
||||||
if (success)
|
if (success && positions)
|
||||||
{
|
{
|
||||||
int pos = positions[0];
|
int pos = positions[0];
|
||||||
if (positions)
|
XtFree ((char *) positions);
|
||||||
XtFree ((char *) positions);
|
|
||||||
return pos - 1;
|
return pos - 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user