From 26564cf29d6fe52e5f993381a662e47271674d0c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 30 Mar 2007 13:41:44 +0000 Subject: [PATCH] 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 --- src/motif/listbox.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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