Main: Fixed memory leak when accessing non-existing value.

Signed-off-by: matematik7 <domen.ipavec@z-v.si>