extractor: track changes in submodule

don't free a struct just before you use an element