Fix memory leak in dial data. Thanks @vignyzheng for pointing this.

This commit is contained in:
Chintan Parikh
2017-12-21 16:29:42 -08:00
parent 7ba715a54e
commit fc267fac62
3 changed files with 17 additions and 1 deletions

View File

@@ -87,3 +87,15 @@ DIALData *retrieve_dial_data(char *app_name) {
return result;
}
void free_dial_data(DIALData **dialData)
{
DIALData *curNode=NULL;
while (*dialData != NULL) {
curNode = *dialData;
*dialData =curNode->next;
free(curNode->key);
free(curNode->value);
free(curNode);
}
}