]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[script] Don't error on object unref of NULL
authorCharlie Brej <cbrej@cs.man.ac.uk>
Thu, 25 Jun 2009 10:39:01 +0000 (11:39 +0100)
committerCharlie Brej <cbrej@cs.man.ac.uk>
Thu, 25 Jun 2009 10:39:01 +0000 (11:39 +0100)
This follows the usage of free with a NULL as well as ply-image etc.

src/plugins/splash/script/script-object.c

index 59eb296e51c8f5f8fb7302ca3ccce0880ba0bf69..115ad3fe3ab003021096c28dc4198e1b3c3a6984 100644 (file)
@@ -34,6 +34,8 @@ void script_obj_ref (script_obj* obj)
 
 void script_obj_unref (script_obj* obj)
 {
+ if (!obj) return;
+ assert(obj->refcount>0);
  obj->refcount--;
  if (obj->refcount<=0){
     script_obj_free (obj);