]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- Always decrement the reference count on an object before dereferencing it,
authorTed Lemon <source@isc.org>
Thu, 28 Dec 2000 23:22:43 +0000 (23:22 +0000)
committerTed Lemon <source@isc.org>
Thu, 28 Dec 2000 23:22:43 +0000 (23:22 +0000)
  so that if there's a dangling pointer, it's caught at dereference time.

omapip/alloc.c

index 55eab6dd528a8d09a95d54edfd35fe1453590712..187c010699b78240ee3657ee5dd47f9a259a8096 100644 (file)
@@ -481,6 +481,7 @@ isc_result_t omapi_object_dereference (omapi_object_t **h,
                        if (outer_reference)
                                omapi_object_dereference
                                        (&(*h) -> outer, file, line);
+                       (*h) -> refcnt--;
                        if (!(*h) -> type -> freer)
                                rc_register (file, line, h, *h, 0);
                        if ((*h) -> type -> destroy)