Some memory leaks (low priority)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • t4nk
    Swordsman
    • May 2016
    • 335

    Some memory leaks (low priority)

    So I spent some time with Valgrind, there are some small memory leaks:
    1) parse_buy_flag() (store.c) makes a string "t" and never frees it
    2) cleanup_artifact() (init.c) frees brands and slays of artefacts, but doesnt free curses
    3) cleanup_player() (player.c) frees player->obj_k, but doesn't free its curses, brands and slays
    Also, I'm curious if anyone makes use of the functionality of mem_alloc() and co. at this point? As far as I can tell, its main reason to exist is to make Valgrind produce some additional "potentially lost" warnings
  • takkaria
    Veteran
    • Apr 2007
    • 1895

    #2
    Originally posted by t4nk
    So I spent some time with Valgrind, there are some small memory leaks:
    1) parse_buy_flag() (store.c) makes a string "t" and never frees it
    2) cleanup_artifact() (init.c) frees brands and slays of artefacts, but doesnt free curses
    3) cleanup_player() (player.c) frees player->obj_k, but doesn't free its curses, brands and slays
    Also, I'm curious if anyone makes use of the functionality of mem_alloc() and co. at this point? As far as I can tell, its main reason to exist is to make Valgrind produce some additional "potentially lost" warnings
    Should be fixed in master, thanks.

    The only thing that mem_alloc() really needs to do that malloc() doesn't is die on failure. The debug stuff can probably go at this point.
    takkaria whispers something about options. -more-

    Comment

    Working...
    😀
    😂
    🥰
    😘
    🤢
    😎
    😞
    😡
    👍
    👎