Merge pull request #16 from sswen/duplex-13

[valgrind] mem-leak: free struct attribute memory before parent struc…

reviewed, build tested