Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hello,

By keeping on reading the logs cclang compilation, I noticed this :
/home/julien/compile-libreoffice/libo/vcl/unx/generic/app/i18n_wrp.cxx:250:9:
warning: Null pointer passed as an argument to a 'nonnull' parameter
        dlclose(g_dlmodule);
        ^       ~~~~~~~~~~
1 warning generated.
Here are the lines : 
    243 Status XvaCloseIM(XIM)
    244 {
    245       Status s = False;
    246 
    247     if (!g_dlmodule)  <<<<< CAUSE OF THE PB
    248     {
    249         /* assuming one XvaOpenIM call */
    250         dlclose(g_dlmodule); <<<<< HERE
    251             g_dlmodule = (void*)0;
    252         g_open_im = (OpenFunction)NULL;
    253         s = True;
    254       }
    255     return (s);
    256 }
So here's an obvious patch :
diff --git a/vcl/unx/generic/app/i18n_wrp.cxx
b/vcl/unx/generic/app/i18n_wrp.cxx
index 3aff25c..b95ad21 100644
--- a/vcl/unx/generic/app/i18n_wrp.cxx
+++ b/vcl/unx/generic/app/i18n_wrp.cxx
@@ -244,7 +244,7 @@ Status XvaCloseIM(XIM)
 {
       Status s = False;
 
-    if (!g_dlmodule)
+    if (g_dlmodule)
     {
         /* assuming one XvaOpenIM call */
         dlclose(g_dlmodule);

I suppose again it's ok to push this fix on master but would it be useful to
push this on 3.5 branch too ? 
Remark : when I opengroked this function , I found nothing. Is this function
used (or should be used) in a way ? 

Julien.

--
View this message in context: 
http://nabble.documentfoundation.org/REVIEW-Null-pointer-passed-as-an-argument-to-a-nonnull-parameter-in-vcl-unx-generic-app-i18n-wrp-cxx-tp3752158p3752158.html
Sent from the Dev mailing list archive at Nabble.com.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.