diff options
author | Tomas Bzatek <tbzatek@redhat.com> | 2014-05-14 18:19:22 +0200 |
---|---|---|
committer | Tomas Bzatek <tbzatek@redhat.com> | 2014-05-15 16:09:14 +0200 |
commit | 85a373f1a64a7b63f291fe9df9aabd89dd2835a9 (patch) | |
tree | 3d5dc19aa2541d8e2614a447ebe644f390c32dc2 | |
parent | 086f5b87aa6ac3ea3cacf4e81903c6851a02f32d (diff) | |
download | openlmi-providers-85a373f1a64a7b63f291fe9df9aabd89dd2835a9.tar.gz openlmi-providers-85a373f1a64a7b63f291fe9df9aabd89dd2835a9.tar.xz openlmi-providers-85a373f1a64a7b63f291fe9df9aabd89dd2835a9.zip |
journald: Fix LMI_JournalLogRecord.PerceivedSeverity
The string conversion was not working at all, we were accessing
already freed memory.
-rw-r--r-- | src/journald/instutil.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/journald/instutil.c b/src/journald/instutil.c index 12f63bf..b3987bc 100644 --- a/src/journald/instutil.c +++ b/src/journald/instutil.c @@ -204,7 +204,6 @@ int create_LMI_JournalLogRecord(sd_journal *j, if (r >= 0 && d != NULL && strlen(d) > 0) { char *conv_err = NULL; long int i = strtol(d, &conv_err, 10); - g_free(d); if (conv_err == NULL || *conv_err == '\0') switch (i) { case LOG_EMERG: @@ -235,6 +234,7 @@ int create_LMI_JournalLogRecord(sd_journal *j, LMI_JournalLogRecord_Set_PerceivedSeverity_Information(rec); break; } + g_free(d); } return 1; |