comparison src/scrollbar-x.c @ 3462:6c7605dfcf07

[xemacs-hg @ 2006-06-19 18:19:33 by james] Fix various problems found by static checkers: use of uninitialized values, dereferencing pointers before checking whether they are NULL, memory leaks, and incomplete checking of return values. <m3k67gpyhk.fsf@jerrypc.cs.usu.edu>
author james
date Mon, 19 Jun 2006 18:19:38 +0000
parents b7f26b2f78bd
children 16112448d484
comparison
equal deleted inserted replaced
3461:fd2936bbfc5f 3462:6c7605dfcf07
70 70
71 /* A device method. */ 71 /* A device method. */
72 static void 72 static void
73 x_free_scrollbar_instance (struct scrollbar_instance *instance) 73 x_free_scrollbar_instance (struct scrollbar_instance *instance)
74 { 74 {
75 if (SCROLLBAR_X_NAME (instance))
76 xfree (SCROLLBAR_X_NAME (instance), char *);
77
78 if (SCROLLBAR_X_WIDGET (instance))
79 {
80 if (XtIsManaged (SCROLLBAR_X_WIDGET (instance)))
81 XtUnmanageChild (SCROLLBAR_X_WIDGET (instance));
82
83 lw_destroy_all_widgets (SCROLLBAR_X_ID (instance));
84 }
85
86 if (instance->scrollbar_data) 75 if (instance->scrollbar_data)
87 xfree (instance->scrollbar_data, void *); 76 {
77 if (SCROLLBAR_X_NAME (instance))
78 xfree (SCROLLBAR_X_NAME (instance), char *);
79
80 if (SCROLLBAR_X_WIDGET (instance))
81 {
82 if (XtIsManaged (SCROLLBAR_X_WIDGET (instance)))
83 XtUnmanageChild (SCROLLBAR_X_WIDGET (instance));
84
85 lw_destroy_all_widgets (SCROLLBAR_X_ID (instance));
86 }
87
88 xfree (instance->scrollbar_data, void *);
89 }
88 } 90 }
89 91
90 /* A device method. */ 92 /* A device method. */
91 static void 93 static void
92 x_release_scrollbar_instance (struct scrollbar_instance *instance) 94 x_release_scrollbar_instance (struct scrollbar_instance *instance)