andy128k / cl-gobject-introspection

BSD 2-Clause "Simplified" License
49 stars 15 forks source link

repository-get-search-path should not free the returned GSList pointer #79

Closed igorcalabria closed 3 years ago

igorcalabria commented 3 years ago

From the docs

The list is internal to GIRepository and should not be freed, nor should its string elements.

To check this, simply call (gir:repository-get-search-path) two times. The second one will fail because the pointer was freed. The issue is that g-slist-to-list always calls (g-slist-free pointer) at the end. So a quick solution would be to add a param to g-slist-to-list that determines if the original list should be freed or not.