diff options
author | James Booth <boothj5@gmail.com> | 2015-05-04 23:29:53 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2015-05-04 23:29:53 +0100 |
commit | 59788752c7269ef30f25e35bf7fdecb2db3fb2b9 (patch) | |
tree | 363d3ea4a833c6d9262d2957db74e6f93b9d4b34 | |
parent | 0930f0f688bc9784b66f8531c4337eaa1106b92a (diff) | |
download | profani-tty-59788752c7269ef30f25e35bf7fdecb2db3fb2b9.tar.gz |
Use null check convention in resource.c
-rw-r--r-- | src/resource.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/resource.c b/src/resource.c index 620dd38d..1598c7b2 100644 --- a/src/resource.c +++ b/src/resource.c @@ -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); |