mirror of
https://github.com/profanity-im/profanity.git
synced 2024-10-06 20:03:46 -04:00
Use null check convention in resource.c
This commit is contained in:
parent
0930f0f688
commit
59788752c7
@ -46,7 +46,7 @@ Resource * resource_new(const char * const name, resource_presence_t presence,
|
||||
Resource *new_resource = malloc(sizeof(struct resource_t));
|
||||
new_resource->name = strdup(name);
|
||||
new_resource->presence = presence;
|
||||
if (status != NULL) {
|
||||
if (status) {
|
||||
new_resource->status = strdup(status);
|
||||
} else {
|
||||
new_resource->status = NULL;
|
||||
@ -88,7 +88,7 @@ resource_compare_availability(Resource *first, Resource *second)
|
||||
|
||||
void resource_destroy(Resource *resource)
|
||||
{
|
||||
if (resource != NULL) {
|
||||
if (resource) {
|
||||
free(resource->name);
|
||||
free(resource->status);
|
||||
free(resource);
|
||||
|
Loading…
Reference in New Issue
Block a user