]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/resolve/resolved-dnssd.c
resolve: fix log message
[thirdparty/systemd.git] / src / resolve / resolved-dnssd.c
index db589f4436040d5d40291e7006a662a184ecc802..c724f8a9b7da7341168fa99f88f41f64c0ff2c95 100644 (file)
@@ -1,20 +1,5 @@
 /***
-  This file is part of systemd.
-
-  Copyright 2017 Dmitry Rozhkov
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+  Copyright © 2017 Dmitry Rozhkov
 ***/
 
 #include "conf-files.h"
@@ -179,7 +164,7 @@ int dnssd_render_instance_name(DnssdService *s, char **ret_name) {
         static const Specifier specifier_table[] = {
                 { 'b', specifier_boot_id,         NULL },
                 { 'H', specifier_dnssd_host_name, NULL },
-                { 'm', specifier_machine_id, NULL },
+                { 'm', specifier_machine_id,      NULL },
                 { 'v', specifier_kernel_release,  NULL },
                 {}
         };
@@ -198,8 +183,7 @@ int dnssd_render_instance_name(DnssdService *s, char **ret_name) {
                 return -EINVAL;
         }
 
-        *ret_name = name;
-        name = NULL;
+        *ret_name = TAKE_PTR(name);
 
         return 0;
 }
@@ -319,8 +303,7 @@ int dnssd_txt_item_new_from_string(const char *key, const char *value, DnsTxtIte
         }
         i->length = length;
 
-        *ret_item = i;
-        i = NULL;
+        *ret_item = TAKE_PTR(i);
 
         return 0;
 }
@@ -345,8 +328,7 @@ int dnssd_txt_item_new_from_data(const char *key, const void *data, const size_t
         }
         i->length = length;
 
-        *ret_item = i;
-        i = NULL;
+        *ret_item = TAKE_PTR(i);
 
         return 0;
 }