Git-Url:
http://git.frugalware.org/gitweb/gitweb.cgi?p=setup.git;a=commitdiff;h=cd15c5af9364bde76af88c0567a7bcf9c6d7e0ac
commit cd15c5af9364bde76af88c0567a7bcf9c6d7e0ac
Author: Miklos Vajna <[EMAIL PROTECTED]>
Date: Mon Jan 21 20:14:38 2008 +0100
fw_checklist(): don't forget to clear the buffer after malloc()
also fixed a memleak when the user hits cancel
diff --git a/src/util.c b/src/util.c
index ef36158..5522d06 100644
--- a/src/util.c
+++ b/src/util.c
@@ -513,12 +513,10 @@ GList* fw_checklist(const char *title, const char
*cprompt, int height,
GList *list=NULL;
MALLOC(dialog_vars.input_result, item_no*256);
+ dialog_vars.input_result[0] = '\0';
ret = dialog_checklist(title, cprompt, height, width,
menu_height, item_no, items, flag);
- if (ret == DLG_EXIT_CANCEL)
- return(NULL);
-
- if(strlen(dialog_vars.input_result)==0)
+ if (ret == DLG_EXIT_CANCEL || !strlen(dialog_vars.input_result))
{
// no item selected
FREE(dialog_vars.input_result);
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git