Resolves: fdo#81039 crash on adding new macro library

regression from

commit bf28399df0b73364b12309032e4a8b571389c2cf
Date:   Fri Feb 7 15:54:45 2014 +0100
    auto_ptr -> heap_ptr

Change-Id: Ib54c708cbdcb97a7489df4a1b3a7e9367f81ff6b