lst and n_mime_items are declared static. The decision that these variables would persist between function calls was taken by the previous developer.