chiark / gitweb /
coredump: don't expose the compression level as configuration option
[elogind.git] / src / journal / journal-remote-parse.c
index 142de0ed1f004a56a25e83378c43f9ec58fc0413..dbdf02aa3c6ba5d8b6ad67858dedb8a4fbc0f6a7 100644 (file)
@@ -40,7 +40,7 @@ void source_free(RemoteSource *source) {
 
 static int get_line(RemoteSource *source, char **line, size_t *size) {
         ssize_t n, remain;
-        char *c;
+        char *c = NULL;
         char *newbuf = NULL;
         size_t newsize = 0;
 
@@ -49,7 +49,9 @@ static int get_line(RemoteSource *source, char **line, size_t *size) {
         assert(source->filled <= source->size);
         assert(source->buf == NULL || source->size > 0);
 
-        c = memchr(source->buf, '\n', source->filled);
+        if (source->buf)
+                c = memchr(source->buf, '\n', source->filled);
+
         if (c != NULL)
                 goto docopy;
 
@@ -175,7 +177,7 @@ static int fill_fixed_size(RemoteSource *source, void **data, size_t size) {
 
 static int get_data_size(RemoteSource *source) {
         int r;
-        void _cleanup_free_ *data = NULL;
+        _cleanup_free_ void *data = NULL;
 
         assert(source);
         assert(source->state == STATE_DATA_START);
@@ -213,7 +215,7 @@ static int get_data_data(RemoteSource *source, void **data) {
 
 static int get_data_newline(RemoteSource *source) {
         int r;
-        char _cleanup_free_ *data = NULL;
+        _cleanup_free_ char *data = NULL;
 
         assert(source);
         assert(source->state == STATE_DATA_FINISH);