There should be no semantic change.

If `result==NULL` then the allocated list is empty, otherwise a string is added. After that the function returns (and it must be assumed, a list was allocated). So the freeing of the list is always done somewhere else.