diff --git a/lib/config/config.c b/lib/config/config.c index 51b869beb..ba16d291a 100644 --- a/lib/config/config.c +++ b/lib/config/config.c @@ -72,7 +72,7 @@ static int _tok_match(const char *str, const char *b, const char *e); /* * public interface */ -struct config_file *create_config_file() +struct config_file *create_config_file(void) { struct cs *c; struct pool *mem = pool_create(10 * 1024); diff --git a/lib/config/config.h b/lib/config/config.h index 6a2159a2c..81bb4ab5f 100644 --- a/lib/config/config.h +++ b/lib/config/config.h @@ -34,7 +34,7 @@ struct config_file { struct config_node *root; }; -struct config_file *create_config_file(); +struct config_file *create_config_file(void); void destroy_config_file(struct config_file *cf); int read_config(struct config_file *cf, const char *file); diff --git a/lib/format1/format1.c b/lib/format1/format1.c index 036665ad6..18c0009f8 100644 --- a/lib/format1/format1.c +++ b/lib/format1/format1.c @@ -451,6 +451,11 @@ struct io_space *create_lvm1_format(const char *prefix, struct pool *mem, { struct io_space *ios = dbg_malloc(sizeof(*ios)); + if (!ios) { + stack; + return NULL; + } + ios->get_vgs = _get_vgs; ios->get_pvs = _get_pvs; ios->pv_read = _pv_read; diff --git a/lib/format1/format1.h b/lib/format1/format1.h index cac9f68ea..d20b6b123 100644 --- a/lib/format1/format1.h +++ b/lib/format1/format1.h @@ -4,8 +4,8 @@ * This file is released under the GPL. */ -#ifndef LVM_FORMAT1_H -#define LVM_FORMAT1_H +#ifndef _LVM_FORMAT1_H +#define _LVM_FORMAT1_H #include "metadata.h"