diff --git a/src/motif/listbox.cpp b/src/motif/listbox.cpp index fc4ea95718..817b9b1c99 100644 --- a/src/motif/listbox.cpp +++ b/src/motif/listbox.cpp @@ -272,11 +272,10 @@ int wxDoFindStringInList(Widget w, const wxString& s) bool success = XmListGetMatchPos (w, str(), &positions, &no_positions); - if (success) + if (success && positions) { int pos = positions[0]; - if (positions) - XtFree ((char *) positions); + XtFree ((char *) positions); return pos - 1; } else