diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-06-10 13:23:06 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-06-10 13:23:12 +0200 |
commit | bac6f28ce1d9abc381c2f85c32bcd37c33cd00c8 (patch) | |
tree | f445f21c76b30a09b0cf7a62ec1ab586d7472d02 | |
parent | f8cf10f2623cbda18e429cc122952859d3e323a5 (diff) |
config: replace config_memdup with blob_memdup from libubox
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r-- | config.c | 14 | ||||
-rw-r--r-- | config.h | 2 | ||||
-rw-r--r-- | device.c | 2 |
3 files changed, 1 insertions, 17 deletions
@@ -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) { @@ -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 @@ -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; |