Freeing memory

Hello, i am studying this part of Apache module mod_spnego code

1
2
      LPCSTR authorization_header = apr_table_get(request->headers_in, "Authorization");


Is It necessary after further code's (which i have omitted) job is done to free memory a LPCSTR is pointing to ? Is It necessary in general when initializing pointers in such way ?
Last edited on
Normally you free memory you have allocated.
If the Apache documentation doesn't say so you shouldn't do it.

Have you bothered to check the documentation?
https://apr.apache.org/docs/apr/2.0/group__apr__tables.html#ga4db13e3915c6b9a3142b175d4c15d915
const char* apr_table_get(const apr_table_t * t, const char * key)
Get the value associated with a given key from the table. After this call, the data is still in the table.


It returns a pointer into the table you passed in. You shouldn't try to deallocate it.
Topic archived. No new replies allowed.