From: Enlightenment C. <no...@cv...> - 2006-04-13 11:04:21
|
Enlightenment CVS committal Author : kwo Project : e16 Module : epplets Dir : e16/epplets/epplets Modified Files: E-Slides.c E-Toolbox.c Log Message: Fix some mem leaks. =================================================================== RCS file: /cvs/e/e16/epplets/epplets/E-Slides.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -3 -r1.30 -r1.31 --- E-Slides.c 12 Apr 2006 19:24:08 -0000 1.30 +++ E-Slides.c 13 Apr 2006 11:03:49 -0000 1.31 @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -static const char cvs_ident[] = "$Id: E-Slides.c,v 1.30 2006/04/12 19:24:08 kwo Exp $"; +static const char cvs_ident[] = "$Id: E-Slides.c,v 1.31 2006/04/13 11:03:49 kwo Exp $"; #include <stdio.h> #include <sys/time.h> @@ -203,9 +203,13 @@ Epplet_send_ipc("goto_desktop ?"); reply = Epplet_wait_for_ipc(); + if (!reply) + return; if ((ptr = strchr(reply, ':')) != NULL) { current_desk = atoi(++ptr); } + free(reply); + Esnprintf(bg_name, sizeof(bg_name), "E_SLIDES_BG_%s", filenames[CUR_PIC()]); Esnprintf(buff, sizeof(buff), "background %s bg.file %s/%s", bg_name, path, filenames[CUR_PIC()]); =================================================================== RCS file: /cvs/e/e16/epplets/epplets/E-Toolbox.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- E-Toolbox.c 13 Apr 2006 08:26:31 -0000 1.13 +++ E-Toolbox.c 13 Apr 2006 11:03:49 -0000 1.14 @@ -21,7 +21,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -static const char cvs_ident[] = "$Id: E-Toolbox.c,v 1.13 2006/04/13 08:26:31 kwo Exp $"; +static const char cvs_ident[] = "$Id: E-Toolbox.c,v 1.14 2006/04/13 11:03:49 kwo Exp $"; #include <stdio.h> #include <sys/time.h> @@ -66,7 +66,7 @@ } tool_config_t; toolbutton_t *buttons; -tool_config_t *cfg_gads; +tool_config_t *cfg_gads = NULL; Epplet_gadget close_button, cfg_button, cfg_popup, cfg_tb_width, cfg_tb_height; char *prog_name = NULL; unsigned long idx = 0, button_cnt = 0; @@ -301,6 +301,10 @@ save_config(); Epplet_window_destroy(config_win); config_win = None; + if (cfg_gads) { + free(cfg_gads); + cfg_gads = NULL; + } return; data = NULL; } @@ -318,6 +322,10 @@ { Epplet_window_destroy(config_win); config_win = None; + if (cfg_gads) { + free(cfg_gads); + cfg_gads = NULL; + } return; data = NULL; } |