test: initialize hwdb so that the test won't try to free memory it has never allocated

See https://github.com/systemd/systemd/pull/10678#issuecomment-436790906.
This commit is contained in:
Evgeny Vereshchagin
2018-11-08 13:49:45 +01:00
parent 79f6178ee1
commit 86f4edef54
+2 -2
View File
@@ -5,7 +5,7 @@
#include "tests.h"
static int test_failed_enumerate(void) {
_cleanup_(sd_hwdb_unrefp) sd_hwdb *hwdb;
_cleanup_(sd_hwdb_unrefp) sd_hwdb *hwdb = NULL;
const char *key, *value;
int r;
@@ -29,7 +29,7 @@ static int test_failed_enumerate(void) {
"evdev:atkbd:dmi:bvnXXX:bvrYYY:bdZZZ:svnDellXXX:pnYYY"
static void test_basic_enumerate(void) {
_cleanup_(sd_hwdb_unrefp) sd_hwdb *hwdb;
_cleanup_(sd_hwdb_unrefp) sd_hwdb *hwdb = NULL;
const char *key, *value;
size_t len1 = 0, len2 = 0;
int r;