$OpenBSD: patch-base_src_client_message_c,v 1.2 2003/05/28 13:27:48 todd Exp $
--- base/src/client/message.c.orig	Sat Mar 29 16:15:27 2003
+++ base/src/client/message.c	Wed May 28 08:14:56 2003
@@ -57,9 +57,12 @@ int
 opencm_confirm(const char *prompt, int dflt_yes)
 {
   char *check = opencm_readline(prompt, dflt_yes ? "yes" : "no");
-  if (strcasecmp(check, "y") == 0 || strcasecmp(check, "yes") == 0)
+  if (strcasecmp(check, "y") == 0 || strcasecmp(check, "yes") == 0) {
+    free(check);
     return 1;
+  }
 
+  free(check);
   return 0;
 }
 
@@ -219,12 +222,12 @@ message_fixup(char *msgbuf)
 char *
 read_message_file(const char *fname, const char *leader)
 {
-  FILE *f = 0;
+  FILE *f = NULL;
 
   /* We now need to re-extract the file content, stripping it of the
      comment lines. Note extra character for trailing newline! */
   int len = path_file_length(fname); /* upper bound if text */
-  char *msgbuf = (char *) GC_MALLOC(sizeof(char) * (len + 2));
+  char *msgbuf = (char *) calloc(1, sizeof(char) * (len + 2));
     
   f = xfopen(fname, 'r', 't');
 
@@ -233,7 +236,7 @@ read_message_file(const char *fname, con
 
   msgbuf[len] = 0;
   msgbuf[len+1] = 0;
-  fclose(f);
+  xfclose(f);
 
   strip_comments(msgbuf, leader);
 
@@ -243,10 +246,10 @@ read_message_file(const char *fname, con
 char *
 get_message(const char *msg, const char *leader, const char *dflt)
 {
-  FILE *f = 0;
+  FILE *f = NULL;
   int len;
   const char *tmpname;
-  char *msgbuf = 0;
+  char *msgbuf = NULL;
   char arg_nlines[20];
   int msg_lines = tmpmsg_nlines(msg);
   const char *contentHash;
@@ -254,7 +257,7 @@ get_message(const char *msg, const char 
   
   if (opt_Message) {
     len = strlen(opt_Message);
-    msgbuf = (char *) GC_MALLOC(sizeof(char) * (len + 2));
+    msgbuf = (char *) calloc(1, sizeof(char) * (len + 2));
     strcpy(msgbuf, opt_Message);
     msgbuf[len] = '\n';
     msgbuf[len+1] = '\0';
