]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
compiles - but warnings are still there
authorMiek Gieben <miekg@NLnetLabs.nl>
Mon, 13 Dec 2004 12:53:30 +0000 (12:53 +0000)
committerMiek Gieben <miekg@NLnetLabs.nl>
Mon, 13 Dec 2004 12:53:30 +0000 (12:53 +0000)
packet.c
rdata.c
rr.c
util.h

index 3b246215ce2b151989da55482ff1cc9f6d67d2d0..3de393eaaa93e5543220acab371c3cbb883cc645 100644 (file)
--- a/packet.c
+++ b/packet.c
@@ -205,7 +205,7 @@ dns_packet_new()
        if (!packet) 
                return NULL;
 
-       MALLOC(packet_header, t_header);
+       MALLOC(packet->header, t_header);
        if (!packet->header)
                return NULL;
        
diff --git a/rdata.c b/rdata.c
index c893075cf5e161451bddc0760f88e006ab754de0..cb4a88778a43e75f6b632f2948578300654ee7ee 100644 (file)
--- a/rdata.c
+++ b/rdata.c
@@ -90,7 +90,7 @@ t_rdata_field *
 rd_field_new_frm_string(t_rd_type t, char *s)
 {
        t_rdata_field *new;
-       new = malloc(1 * sizeof t_rdata_field ) ;
+       MALLOC(new, t_rdata_field);
 
        if (!new)
                return NULL;
diff --git a/rr.c b/rr.c
index ccf36864763a40e0b9936c8f8c938c8d846bb58e..7a8865c86a64d848350a3af010e5ed15e0f0b641 100644 (file)
--- a/rr.c
+++ b/rr.c
@@ -81,8 +81,7 @@ rr_push_rd_field(t_rr *rr, t_rdata_field *f)
        rd_count = rr_rd_count(rr);
        
        /* grow the array */
-       rr->rdata_fields = xrealloc(rr->rdata_fields, 
-                       (rd_count + 1) * sizeof(t_rdata_field *));
+       XREALLOC(rr->rdata_fields, t_rdata_field, (rd_count + 1));
 
        /* add the new member */
        rr->rdata_fields[rd_count] = f;
diff --git a/util.h b/util.h
index deaa39902e058a78f78beb0ab6ec1522ddb8772a..7b942eb9c1b325975e640984eb46d63d9d7750f8 100644 (file)
--- a/util.h
+++ b/util.h
  * Memory management macro's
  */
 #define MALLOC(ptr, type) \
-        XMALLOC((ptr), (type), 1)
+        XMALLOC((ptr), type, 1)
 
 #define XMALLOC(ptr, type, count) \
-        (ptr) = ((type) *) malloc((count) * sizeof(type))
+        (ptr) = (type *) malloc((count) * sizeof(type))
 
 #define REALLOC(ptr, type) \
-        XREALLOC((ptr), (type), 1)
+        XREALLOC((ptr), type, 1)
 
 #define XREALLOC(ptr, type, count) \
-        (ptr) == ((type) *) realloc((count) * sizeof(type))
+        (ptr) == (type *) realloc((ptr), (count) * sizeof(type))
 
 #define FREE(ptr) \
-    do { free(ptr); (ptr) = NULL; } while (0)
+    do { free((ptr)); (ptr) = NULL; } while (0)
 
 #define DEP     printf("DEPRICATED FUNCTION!\n");