[Libreoffice] [PATCH] [PUSHED] cppcheck cleaning in vcl

David Tardon dtardon at redhat.com
Mon Jan 3 23:23:36 PST 2011

On Thu, Dec 30, 2010 at 06:43:12PM +0100, Julien Nabet wrote:
> Hello,
> Here is a patch for cppcheck cleaning in vcl
> Compiling was ok.
> I'm not sure if what I did about realloc pb in the file :
> vcl/unx/source/gdi/xlfd_attr.cxx
> was sufficient (even correct !).

If Enlarge() failed, Insert() silently returns whatever value
mnLastmatch happened to be, that means that you replaced possible
segfault with possible wrong behaviour :( IMHO the right thing here is
to throw std::bad_alloc if the reallocation failed and I changed the
patch accordingly.


More information about the LibreOffice mailing list