summaryrefslogtreecommitdiff
path: root/src/shared/efivars.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-10-12 12:15:49 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-10-13 17:56:54 -0400
commitb47d419c25ecc735615a1088060c1ec8bef1e41f (patch)
tree13940040841fbec3a928f82426390654e4b50fcc /src/shared/efivars.c
parent7ff7394d9e4e9189c30fd018235e6b1728c6f2d0 (diff)
Modernization
Fixes minor leak in error path in device.c.
Diffstat (limited to 'src/shared/efivars.c')
-rw-r--r--src/shared/efivars.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/shared/efivars.c b/src/shared/efivars.c
index f3eb6a6e5d..000dae9de0 100644
--- a/src/shared/efivars.c
+++ b/src/shared/efivars.c
@@ -37,7 +37,7 @@ bool is_efi_boot(void) {
static int read_flag(const char *varname) {
int r;
- void *v;
+ _cleanup_free_ void *v = NULL;
size_t s;
uint8_t b;
@@ -45,15 +45,11 @@ static int read_flag(const char *varname) {
if (r < 0)
return r;
- if (s != 1) {
- r = -EINVAL;
- goto finish;
- }
+ if (s != 1)
+ return -EINVAL;
b = *(uint8_t *)v;
r = b > 0;
-finish:
- free(v);
return r;
}