-/* $OpenBSD: sensorsd.c,v 1.54 2015/01/16 06:40:20 deraadt Exp $ */
+/* $OpenBSD: sensorsd.c,v 1.55 2015/06/02 23:05:05 millert Exp $ */
/*
* Copyright (c) 2003 Henning Brauer <henning@openbsd.org>
if (cgetstr(buf, "low", &ebuf) < 0)
ebuf = NULL;
p->lower = get_val(ebuf, 0, p->type);
+ free(ebuf);
if (cgetstr(buf, "high", &ebuf) < 0)
ebuf = NULL;
p->upper = get_val(ebuf, 1, p->type);
+ free(ebuf);
if (cgetstr(buf, "command", &ebuf) < 0)
ebuf = NULL;
- if (ebuf)
- asprintf(&(p->command), "%s", ebuf);
+ if (ebuf != NULL) {
+ p->command = ebuf;
+ ebuf = NULL;
+ }
free(buf);
buf = NULL;
if (p->lower != LLONG_MIN || p->upper != LLONG_MAX)