From: <dg...@su...> - 2009-02-05 09:19:40
|
Author: bellmich Date: Thu Feb 5 10:17:54 2009 New Revision: 915 URL: http://libsyncml.opensync.org/changeset/915 Log: If somebody no longer references an error then the error should no longer be accessible for him. Modified: trunk/libsyncml/sml_error.c Modified: trunk/libsyncml/sml_error.c ============================================================================== --- trunk/libsyncml/sml_error.c Thu Feb 5 10:16:30 2009 (r914) +++ trunk/libsyncml/sml_error.c Thu Feb 5 10:17:54 2009 (r915) @@ -241,8 +241,10 @@ if (!smlErrorIsSet(error)) return; - if (!g_atomic_int_dec_and_test(&(*error)->refCount)) + if (!g_atomic_int_dec_and_test(&((*error)->refCount))) { + *error = NULL; return; + } if ((*error)->message) smlSafeCFree (&((*error)->message)); |