[3.0] dynamicoverlay: Fix memory leak when updating pictures
In exec_DataSharedMem() memory is allocated via the call to picture_New(). This memory is correctly freed via picture_Release() if an error occurs, but if no error occurs and the function proceeds normally, the memory is never freed. When the DataSharedMem routine is called repeatedly (e.g., to update a picture continuously), this leak accumulates very quickly.
Backport of MR 2320.
Edited by Steve Lhomme