Rocco Rutte:
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Sun, 20 Mar 2005 21:45:55 +0000 (21:45 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Sun, 20 Mar 2005 21:45:55 +0000 (21:45 +0000)
get rid of former safe_free(), use FREE() (noted by Elimar Riesebieter)

git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@214 e385b8ad-14ed-0310-8656-cc95a2468c6d

mutt_ssl_gnutls.c
rfc822.c

index 5bf6b5a..08aa1ea 100644 (file)
@@ -268,7 +268,7 @@ static int tls_socket_close (CONNECTION * conn)
 
     gnutls_certificate_free_credentials (data->xcred);
     gnutls_deinit (data->state);
-    safe_free ((void **) &conn->sockdata);
+    FREE(&conn->sockdata);
   }
 
   return raw_socket_close (conn);
@@ -414,7 +414,7 @@ static int tls_check_stored_hostname (const gnutls_datum * cert,
           if (strcmp (linestr + pmatch[1].rm_so, hostname) == 0 &&
               strcmp (linestr + pmatch[2].rm_so, buf) == 0) {
             regfree (&preg);
-            safe_free ((void **) &linestr);
+            FREE(&linestr);
             fclose (fp);
             return 1;
           }
index 1075853..f1c86e9 100644 (file)
--- a/rfc822.c
+++ b/rfc822.c
 #include <ctype.h>
 #include <stdlib.h>
 
-#ifndef TESTING
 #include "mutt.h"
-#else
-#define safe_strdup strdup
-#define safe_malloc malloc
-#define SKIPWS(x) while(isspace(*x))x++
-#define FREE(x) safe_free(x)
-#define ISSPACE isspace
-#define strfcpy(a,b,c) {if (c) {strncpy(a,b,c);a[c-1]=0;}}
-#define STRING 128
-#include "rfc822.h"
-#endif
-
 #include "mutt_idna.h"
 
 #include "lib/mem.h"
@@ -732,31 +720,3 @@ ADDRESS *rfc822_append (ADDRESS ** a, ADDRESS * b)
     tmp = tmp->next;
   return tmp;
 }
-
-#ifdef TESTING
-int safe_free (void **p)
-{
-  free (*p);                    /* __MEM_CHECKED__ */
-  *p = 0;
-}
-
-int main (int argc, char **argv)
-{
-  ADDRESS *list;
-  char buf[256];
-
-# if 0
-  char *str =
-    "michael, Michael Elkins <me@mutt.org>, testing a really complex address: this example <@contains.a.source.route,@with.multiple.hosts:address@example.com>;, lothar@of.the.hillpeople (lothar)";
-# else
-  char *str = "a b c ";
-# endif
-
-  list = rfc822_parse_adrlist (NULL, str);
-  buf[0] = 0;
-  rfc822_write_address (buf, sizeof (buf), list);
-  rfc822_free_address (&list);
-  puts (buf);
-  exit (0);
-}
-#endif