chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
journal-remote: fix memleak
[elogind.git]
/
src
/
journal
/
journal-remote.c
diff --git
a/src/journal/journal-remote.c
b/src/journal/journal-remote.c
index 794298fe6f76a1c09431ed5f1e24ee0fbff479b5..31401fb3ee7e6e51d81a1abae3f06316baa3c86e 100644
(file)
--- a/
src/journal/journal-remote.c
+++ b/
src/journal/journal-remote.c
@@
-42,7
+42,6
@@
#include "macro.h"
#include "strv.h"
#include "fileio.h"
#include "macro.h"
#include "strv.h"
#include "fileio.h"
-#include "socket-util.h"
#include "microhttpd-util.h"
#ifdef HAVE_GNUTLS
#include "microhttpd-util.h"
#ifdef HAVE_GNUTLS
@@
-186,7
+185,7
@@
static int open_output(Writer *s, const char* url) {
if (r < 0)
return log_oom();
} else {
if (r < 0)
return log_oom();
} else {
- r = is_dir(arg_output);
+ r = is_dir(arg_output
, true
);
if (r > 0) {
r = asprintf(&output,
"%s/remote-%s.journal", arg_output, name);
if (r > 0) {
r = asprintf(&output,
"%s/remote-%s.journal", arg_output, name);
@@
-292,7
+291,7
@@
static int remove_source(RemoteServer *s, int fd) {
static int add_source(RemoteServer *s, int fd, const char* name) {
RemoteSource *source = NULL;
static int add_source(RemoteServer *s, int fd, const char* name) {
RemoteSource *source = NULL;
-
char *realname
;
+
_cleanup_free_ char *realname = NULL
;
int r;
assert(s);
int r;
assert(s);
@@
-308,11
+307,11
@@
static int add_source(RemoteServer *s, int fd, const char* name) {
return log_oom();
}
return log_oom();
}
- log_debug("Creating source for fd:%d (%s)", fd, name);
+ log_debug("Creating source for fd:%d (%s)", fd,
real
name);
r = get_source_for_fd(s, fd, &source);
if (r < 0) {
r = get_source_for_fd(s, fd, &source);
if (r < 0) {
- log_error("Failed to create source for fd:%d (%s)", fd, name);
+ log_error("Failed to create source for fd:%d (%s)", fd,
real
name);
return r;
}
assert(source);
return r;
}
assert(source);
@@
-1211,8
+1210,8
@@
int main(int argc, char **argv) {
if (remoteserver_init(&s) < 0)
return EXIT_FAILURE;
if (remoteserver_init(&s) < 0)
return EXIT_FAILURE;
- log_debug("%s running as pid
%lu"
,
- program_invocation_short_name,
(unsigned long)
getpid());
+ log_debug("%s running as pid
"PID_FMT
,
+ program_invocation_short_name, getpid());
sd_notify(false,
"READY=1\n"
"STATUS=Processing requests...");
sd_notify(false,
"READY=1\n"
"STATUS=Processing requests...");