Does the glib list in the called function need to be free for deallocating memory

前端 未结 1 1240
感情败类
感情败类 2021-01-26 09:18

I have a simple program that uses glib list where I have a function which returns the list to the calling function

.here in the called function i have decleared another

相关标签:
1条回答
  • 2021-01-26 10:04

    Like TingPing mentioned, strtok_r doesn't allocate any memory, so no you don't need to free it.

    If you did need to free it (for example if you were to strdup the value from strtok_r) then you would most likely want to use g_slist_free_full.

    0 讨论(0)
提交回复
热议问题