At least for glibc, you shouldn't. The source indicates that the pointer is to a member of an internal state struct, so it's not something you can directly free.
The docs also hint at this:
To read the entire content of the of the
fstab file the GNU C
Library contains a set of three functions which are designed in the
The "usual" way here being something like
The return value may point to a static area, and may be overwritten
by subsequent calls to
not pass the returned pointer to
Also, the glibc docs specifically for
The function returns a pointer to a variable of type
This variable is shared by all threads and therefore this function is
not thread-safe. If an error occurred getfsent returns a
That that variable is shared is a strong indication you should not mess with memory management.
If you want to free the resources, use
endfsent(), which will clear the internal state.