vw_bap_frame_alloc()
authornorly <ny-git@enpas.org>
Mon, 3 Apr 2017 23:05:31 +0000 (01:05 +0200)
committernorly <ny-git@enpas.org>
Mon, 3 Apr 2017 23:05:31 +0000 (01:05 +0200)
vw-bap.c

index 13fcc3c57d13bf2feb145983474ff53606ab328c..436bd9c911551c450d00e4e567516f8dd0100614 100644 (file)
--- a/vw-bap.c
+++ b/vw-bap.c
@@ -8,6 +8,26 @@
 #include "vw-bap.h"
 
 
+
+struct BAP_Frame* vw_bap_frame_alloc(void)
+{
+       struct BAP_Frame* bap_frame;
+
+       bap_frame = calloc(1, sizeof(struct BAP_Frame));
+
+       return bap_frame;
+}
+
+
+void vw_bap_frame_free(struct BAP_Frame *bap_frame)
+{
+       free(bap_frame);
+}
+
+
+
+
+
 void vw_bap_frame_dump(struct BAP_Frame *bap_frame)
 {
        unsigned i;
@@ -75,7 +95,7 @@ struct BAP_Frame* vw_bap_handle_can_frame(struct BAP_RXer *bap, struct can_frame
                        }
                        bap->mfchannel[mfchannel] = NULL;
 
-                       bap_frame = calloc(1, sizeof(struct BAP_Frame));
+                       bap_frame = vw_bap_frame_alloc();
                        if (!bap_frame) {
                                printf("bap_handle_can_frame: Failed to allocate new frame\n");
                                return NULL;
@@ -178,13 +198,6 @@ struct BAP_Frame* vw_bap_handle_can_frame(struct BAP_RXer *bap, struct can_frame
 
 
 
-void vw_bap_frame_free(struct BAP_Frame *bap_frame)
-{
-       free(bap_frame);
-}
-
-
-
 struct BAP_RXer* vw_bap_rxer_alloc()
 {
        struct BAP_RXer *bap;