From 6592db6bb526f0c43b4c7b55859c629709e039b4 Mon Sep 17 00:00:00 2001 From: Mikhail Gusarov Date: Fri, 4 Jun 2010 16:58:58 +0700 Subject: Get rid of xstrdup when argument is definitely non-NULL Replace xstrdup with strdup when either constant string is being duplicated or argument is guarded by conditionals and obviously can't be NULL Signed-off-by: Mikhail Gusarov Reviewed-by: Alan Coopersmith --- config/udev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'config/udev.c') diff --git a/config/udev.c b/config/udev.c index 16c462455..993449075 100644 --- a/config/udev.c +++ b/config/udev.c @@ -86,8 +86,8 @@ device_added(struct udev_device *udev_device) if (!options) return; - options->key = xstrdup("_source"); - options->value = xstrdup("server/udev"); + options->key = strdup("_source"); + options->value = strdup("server/udev"); if (!options->key || !options->value) goto unwind; @@ -197,7 +197,7 @@ device_added(struct udev_device *udev_device) for (; dev; dev = dev->next) { free(dev->config_info); - dev->config_info = xstrdup(config_info); + dev->config_info = strdup(config_info); } unwind: -- cgit v1.2.3