Merge pull request #2425 from yuwata/journal-remote-v4
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 24 Jan 2016 16:47:19 +0000 (11:47 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 24 Jan 2016 16:49:31 +0000 (11:49 -0500)
ZJS: remove unnecessary oom check after strdupa().

1  2 
src/journal-remote/journal-remote.c

@@@ -917,7 -927,15 +927,13 @@@ static int remoteserver_init(RemoteServ
                          startswith(arg_url, "http://") ?:
                          arg_url;
  
-                 r = add_source(s, fd, (char*) hostname, false);
+                 hostname = strdupa(hostname);
 -                if (!hostname)
 -                        return log_oom();
+                 if ((p = strchr(hostname, '/')))
+                         *p = '\0';
+                 if ((p = strchr(hostname, ':')))
+                         *p = '\0';
+                 r = add_source(s, fd, hostname, false);
                  if (r < 0)
                          return r;
          }