mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-22 06:21:45 +03:00
useragent: Add a free_user_agent_string() function
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
parent
2d87e7ebea
commit
6c2d97bf01
@ -78,3 +78,13 @@ user_agent_string(void)
|
||||
return core_user_agent_string;
|
||||
}
|
||||
|
||||
/* Public API documented in useragent.h */
|
||||
void
|
||||
free_user_agent_string(void)
|
||||
{
|
||||
if (core_user_agent_string != NULL) {
|
||||
/* Nasty cast because we need to de-const it to free it */
|
||||
free((void *)core_user_agent_string);
|
||||
core_user_agent_string = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -27,4 +27,11 @@
|
||||
*/
|
||||
const char * user_agent_string(void);
|
||||
|
||||
/** Free any memory allocated for the user_agent_string
|
||||
*
|
||||
* After calling this, the value returned by \ref user_agent_string()
|
||||
* is to be considered invalid.
|
||||
*/
|
||||
void free_user_agent_string(void);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user