Make NULL a valid input for notification_free

This commit is contained in:
Benedikt Heine 2018-07-08 11:25:34 +02:00
parent 54ce81ccca
commit 646d037b15
2 changed files with 4 additions and 2 deletions

View File

@ -204,7 +204,9 @@ void rawimage_free(RawImage *i)
/* see notification.h */
void notification_free(notification *n)
{
assert(n != NULL);
if (!n)
return;
g_free(n->appname);
g_free(n->summary);
g_free(n->body);

View File

@ -119,7 +119,7 @@ void rawimage_free(RawImage *i);
/**
* Free the memory used by the given notification.
*
* @param n: pointer to #notification
* @param n (nullable): pointer to #notification
*/
void notification_free(notification *n);