diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-01-16 11:48:25 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-01-16 11:53:43 +0100 |
commit | e520e0fc2c6075a592d62175232849f19f7b7417 (patch) | |
tree | ffd6f28a082cdf7da812308d4998f25ce682f7e4 /src/import/curl-util.c | |
parent | fc432c231450166b31127f4cd0965d85e2ea15df (diff) | |
download | systemd-e520e0fc2c6075a592d62175232849f19f7b7417.tar.gz |
locale-util: add freelocale() cleanup helper
Diffstat (limited to 'src/import/curl-util.c')
-rw-r--r-- | src/import/curl-util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/import/curl-util.c b/src/import/curl-util.c index 7069c95a9f..62bbaa500d 100644 --- a/src/import/curl-util.c +++ b/src/import/curl-util.c @@ -21,6 +21,7 @@ #include "alloc-util.h" #include "curl-util.h" #include "fd-util.h" +#include "locale-util.h" #include "string-util.h" static void curl_glue_check_finished(CurlGlue *g) { @@ -414,8 +415,8 @@ int curl_header_strdup(const void *contents, size_t sz, const char *field, char } int curl_parse_http_time(const char *t, usec_t *ret) { + _cleanup_(freelocalep) locale_t loc = (locale_t) 0; const char *e; - locale_t loc; struct tm tm; time_t v; @@ -434,7 +435,6 @@ int curl_parse_http_time(const char *t, usec_t *ret) { if (!e || *e != 0) /* ANSI C */ e = strptime_l(t, "%a %b %d %H:%M:%S %Y", &tm, loc); - freelocale(loc); if (!e || *e != 0) return -EINVAL; |