Menu

Memory Leak

2012-01-09
2013-05-08
  • Stefan Newbold

    Stefan Newbold - 2012-01-09

    Has anyone else experienced a memory leak in the function:
    rp_ack_fully_decode_service_request ?

    It is in: h_rp_a.c

    I've used valgrind to pinpoint it and its coming from the following calloc
    call:

    rp1_property = calloc(1, sizeof (BACNET_PROPERTY_REFERENCE));

    I set a trap at the end of the function to call "free" if rp1_property is not
    NULL.

    Valgrind then complains about another leak at for the following line:

    value = calloc(1, sizeof (BACNET_APPLICATION_DATA_VALUE));

    Using the same trapping approach at the end of this function doesn't work for
    that leak.

    Any others experienced the same problem?

    Thanks.

     
  • vogel

    vogel - 2013-03-29

    My situation is just the same as you! And now i am nearly sure that the function rp_ack_fully_decode_service_request is bad for the memory, because i wrote a small code-block to test, and the result is not so good!(after about half an hour my arm9 meet the OOM killer.)
    Now i rewrite the function rp_ack_print_data() for my ReadProperty service, and everything goes well.

     
  • Steve Karg

    Steve Karg - 2013-04-12

    I'd be happy to patch that handler code if you are interested in sharing your fixes.

     
  • vogel

    vogel - 2013-05-08

    Hello Steve,

    I just simply rewrite the function rp_ack_print_data(BACNET_READ_PROPERTY_DATA * data) from h_rp_a.c, and replace the print_data (in bacrp) using the function rp_ack_kk_data(BACNET_READ_PROPERTY_DATA * data, BACNET_OBJECT_PROPERTY_VALUE * object_value).

    thx for your job

     

Log in to post a comment.