Mercurial > pidgin
changeset 13418:ad33debf87b4
[gaim-migrate @ 15793]
Better NULL checking...
Resolves CID 62:
Event deref_ptr: Directly dereferenced pointer "wb"
75 if(wb->ui_data)
Event check_after_deref: Pointer "wb" dereferenced before NULL check
86 if(wb)
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Tue, 07 Mar 2006 01:58:34 +0000 |
parents | dc05405864bd |
children | 3e9c865abd3f |
files | src/whiteboard.c |
diffstat | 1 files changed, 5 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/whiteboard.c Tue Mar 07 01:56:29 2006 +0000 +++ b/src/whiteboard.c Tue Mar 07 01:58:34 2006 +0000 @@ -72,6 +72,8 @@ void gaim_whiteboard_destroy(GaimWhiteboard *wb) { + g_return_if_fail(wb != NULL); + if(wb->ui_data) { /* Destroy frontend */ @@ -83,15 +85,9 @@ if(wb->prpl_ops && wb->prpl_ops->end) wb->prpl_ops->end(wb); - if(wb) - { - if(wb->who) - g_free(wb->who); - - wbList = g_list_remove(wbList, wb); - - g_free(wb); - } + g_free(wb->who); + wbList = g_list_remove(wbList, wb); + g_free(wb); } void gaim_whiteboard_start(GaimWhiteboard *wb)