From: Felix Fietkau Date: Mon, 10 Jun 2013 11:23:06 +0000 (+0200) Subject: config: replace config_memdup with blob_memdup from libubox X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=bac6f28ce1d9abc381c2f85c32bcd37c33cd00c8;p=oweals%2Fnetifd.git config: replace config_memdup with blob_memdup from libubox Signed-off-by: Felix Fietkau --- diff --git a/config.c b/config.c index f3e5f9d..9c1127b 100644 --- a/config.c +++ b/config.c @@ -366,20 +366,6 @@ config_check_equal(struct blob_attr *c1, struct blob_attr *c2, return true; } -struct blob_attr * -config_memdup(struct blob_attr *attr) -{ - struct blob_attr *ret; - int size = blob_pad_len(attr); - - ret = malloc(size); - if (!ret) - return NULL; - - memcpy(ret, attr, size); - return ret; -} - static struct uci_package * config_init_package(const char *config) { diff --git a/config.h b/config.h index c5e4200..975ba24 100644 --- a/config.h +++ b/config.h @@ -58,6 +58,4 @@ bool config_check_equal(struct blob_attr *c1, struct blob_attr *c2, bool config_diff(struct blob_attr **tb1, struct blob_attr **tb2, const struct config_param_list *config, unsigned long *diff); -struct blob_attr *config_memdup(struct blob_attr *attr); - #endif diff --git a/device.c b/device.c index 1c0736f..5fa0ac1 100644 --- a/device.c +++ b/device.c @@ -584,7 +584,7 @@ device_create(const char *name, const struct device_type *type, struct device *odev = NULL, *dev; enum dev_change_type change; - config = config_memdup(config); + config = blob_memdup(config); if (!config) return NULL;