summaryrefslogtreecommitdiff
path: root/pico
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2018-05-13 01:38:56 -0600
committerEduardo Chappa <chappa@washington.edu>2018-05-13 01:38:56 -0600
commitaac7b10863bcfabe936feb5151e7e11123e13306 (patch)
tree8033a31daed6c94fcbdd41eef1682ba0539cfabd /pico
parent400647dcc1b040f82d22d539fc013f5e23132049 (diff)
downloadalpine-aac7b10863bcfabe936feb5151e7e11123e13306.tar.xz
* More changes to make Valgrind happy. Work in progress.
Diffstat (limited to 'pico')
-rw-r--r--pico/efunc.h1
-rw-r--r--pico/line.c4
-rw-r--r--pico/pico.c17
3 files changed, 21 insertions, 1 deletions
diff --git a/pico/efunc.h b/pico/efunc.h
index 95f5fc08..bcdcb23b 100644
--- a/pico/efunc.h
+++ b/pico/efunc.h
@@ -209,6 +209,7 @@ extern int ctrlg(int, int);
extern int rdonly(void);
extern int pico_help(char **, char *, int);
extern void zotedit(void);
+extern void free_pico_module_globals(void);
#ifdef _WINDOWS
int composer_file_drop(int, int, char *);
int pico_cursor(int, long);
diff --git a/pico/line.c b/pico/line.c
index 807c7a23..57c39b04 100644
--- a/pico/line.c
+++ b/pico/line.c
@@ -90,7 +90,9 @@ lalloc(int used)
lp->l_size = size;
lp->l_used = used;
- lp->l_sig = 0; /* assume it is not a signature line */
+ lp->l_sig = 0; /* assume it is not a signature line */
+ lp->l_text[0].c = '\0'; /* this is not necessary */
+ lp->l_text[0].a = lp->l_text[0].d = 0; /* but it makes valgrind happy */
return (lp);
}
diff --git a/pico/pico.c b/pico/pico.c
index 2df13204..67e98596 100644
--- a/pico/pico.c
+++ b/pico/pico.c
@@ -1927,6 +1927,23 @@ breplace(void *w)
curwp->w_flag |= WFHARD;
}
+void
+free_pico_module_globals(void)
+{
+ int i;
+
+ for(i = 0; i < 12; i++){
+ if(menuitems[i].kncp)
+ free_color_pair(&menuitems[i].kncp);
+ if(menuitems[i].klcp)
+ free_color_pair(&menuitems[i].klcp);
+ if(menuitems[i].label){
+ free((void *) menuitems[i].label);
+ menuitems[i].label = NULL;
+ }
+ }
+}
+
#ifdef _WINDOWS
/*