]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
sub: remove useless interlediary variable
authorBaptiste Daroussin <bapt@FreeBSD.org>
Wed, 5 Jul 2023 13:23:30 +0000 (15:23 +0200)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Wed, 5 Jul 2023 13:23:30 +0000 (15:23 +0200)
src/subscriberfuncs.c

index 566a985e6c1d816d34e159941287e04b32d87dd2..69a6ffc8a7d3afac21fef25abc235580af985a9b 100644 (file)
@@ -404,7 +404,7 @@ void
 mod_get_addr_and_type(struct ml *ml, const char *modstr, char **addrptr, enum subtype *subtypeptr)
 {
        int fd;
-       char *readaddr, *readtype, *modfilename;
+       char *readtype, *modfilename;
        char *buf, *walk;
 
        if (strncmp(modstr, "subscribe", 9) == 0)
@@ -422,9 +422,8 @@ mod_get_addr_and_type(struct ml *ml, const char *modstr, char **addrptr, enum su
                log_error(LOG_ARGS, "Could not open %s/%s", ml->dir, modfilename);
                exit(EXIT_FAILURE);
        }
-       readaddr = xstrdup(strsep(&walk, "\n"));
+       *addrptr = xstrdup(strsep(&walk, "\n"));
        readtype = strsep(&walk, "\n");
-       *addrptr = readaddr;
 
        for (size_t i = 0; i < NELEM(subtypes); i++) {
                if (subtypes[i] == NULL)