Cleanup some Memory Leaks

This commit is contained in:
Axel Wagner 2010-08-04 04:07:16 +02:00
parent 27aa9a640e
commit 51d466c41c
3 changed files with 9 additions and 1 deletions

View File

@ -144,6 +144,7 @@ void got_data(struct ev_loop *loop, ev_io *watcher, int events) {
reply_handlers[type](buffer); reply_handlers[type](buffer);
} }
FREE(header);
FREE(buffer); FREE(buffer);
} }

View File

@ -158,8 +158,15 @@ int main(int argc, char **argv) {
ev_prepare_stop(main_loop, ev_prep); ev_prepare_stop(main_loop, ev_prep);
ev_check_stop(main_loop, ev_chk); ev_check_stop(main_loop, ev_chk);
ev_io_stop(main_loop, xcb_io);
ev_io_stop(main_loop, child_io);
FREE(xcb_io);
FREE(ev_prep); FREE(ev_prep);
FREE(ev_chk); FREE(ev_chk);
free(child_io);
FREE(statusline);
ev_default_destroy(); ev_default_destroy();
clean_xcb(); clean_xcb();

View File

@ -147,9 +147,9 @@ void init_xcb() {
cookie, cookie,
NULL); NULL);
font_height = reply->font_ascent + reply->font_descent; font_height = reply->font_ascent + reply->font_descent;
FREE(reply);
printf("Calculated Font-height: %d\n", font_height); printf("Calculated Font-height: %d\n", font_height);
/* FIXME: Maybe we can push that further backwards */ /* FIXME: Maybe we can push that further backwards */
get_atoms(); get_atoms();
} }