diff options
author | woglinde <woglinde@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-07-26 16:14:29 +0000 |
---|---|---|
committer | woglinde <woglinde@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-07-26 16:14:29 +0000 |
commit | fcb867578ec6bba0edae14aa21679fada7a0bb62 (patch) | |
tree | ba97e72673dbe778b6ab6199fbfeacc0768f5d14 /navit/osd | |
parent | e953ae86a2164112bd70fea3a97ff59e2ceadae5 (diff) | |
download | navit-fcb867578ec6bba0edae14aa21679fada7a0bb62.tar.gz |
Fix:osd_core:Do the null pointer check before assiging a variable, found with smatch
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@4660 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/osd')
-rw-r--r-- | navit/osd/core/osd_core.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/navit/osd/core/osd_core.c b/navit/osd/core/osd_core.c index bc086372f..e246ffee2 100644 --- a/navit/osd/core/osd_core.c +++ b/navit/osd/core/osd_core.c @@ -841,10 +841,14 @@ osd_cmd_interface_init(struct cmd_interface *this, struct navit *nav) static int osd_cmd_interface_set_attr(struct cmd_interface *this_, struct attr* attr) { - struct navit* nav = this_->osd_item.navit; + struct navit* nav; + if(NULL==attr || NULL==this_) { return 0; - } + } + + nav = this_->osd_item.navit; + if(attr->type == attr_status_text) { if(this_->text) { g_free(this_->text); |