diff options
author | norly <ny-git@enpas.org> | 2017-04-04 01:05:31 +0200 |
---|---|---|
committer | norly <ny-git@enpas.org> | 2017-04-04 01:05:31 +0200 |
commit | aa1bac903b74108d17a2b58549d1d6630373047f (patch) | |
tree | 2b8da1f7d0f2684e38ebbbc7eef31d7a1589ace0 | |
parent | a072b40d337518faa4686b9a9a69ccbde6765f86 (diff) |
vw_bap_frame_alloc()
-rw-r--r-- | vw-bap.c | 29 |
1 files changed, 21 insertions, 8 deletions
@@ -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; |