Dear PCManFM developers,
letting the static C/C++ code analyzer Cppcheck
$ cppcheck --version
Cppcheck 1.56
look at the libfm and pcmanfm sources, only the following error was
reported.
libfm(master) $ git describe
1.0.1-196-g004d727
libfm(master) $ cppcheck .
Checking src/actions/action.c...
[src/actions/action.c:432]: (error) Possible null pointer dereference:
self
[src/actions/action.c:433]: (error) Possible null pointer dereference:
self
[src/actions/action.c:713]: (error) Possible null pointer dereference:
self
[src/actions/action.c:714]: (error) Possible null pointer dereference:
self
[…]
Looking at the source
FmFileAction* fm_file_action_construct (GType object_type, const gchar*
desktop_id) {
FmFileAction * self = NULL;
GKeyFile* _tmp0_;
GKeyFile* kf;
const gchar* _tmp1_;
gchar* _tmp2_;
GError * _inner_error_ = NULL;
g_return_val_if_fail (desktop_id != NULL, NULL);
_tmp0_ = g_key_file_new ();
kf = _tmp0_;
_tmp1_ = desktop_id;
_tmp2_ = g_strdup (_tmp1_);
_g_free0 (((FmFileActionObject*) self)->id);
((FmFileActionObject*) self)->id = _tmp2_;
[…]
I wonder how this is supposed to work, as self is set to NULL in the
beginning. So Cppcheck seems to be right.
Thanks,
Paul
signature.asc
Description: This is a digitally signed message part
------------------------------------------------------------------------------ Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________ Pcmanfm-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pcmanfm-develop
