From 1fef96e2031952fccc4cf9ed189b50fec9360a06 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 22 May 2011 21:28:58 +0200 Subject: assorted cleanups, memory leak fix (g_list_free in add_basics_to_problem_data) Signed-off-by: Denys Vlasenko --- src/plugins/abrt-action-analyze-c.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/plugins/abrt-action-analyze-c.c') diff --git a/src/plugins/abrt-action-analyze-c.c b/src/plugins/abrt-action-analyze-c.c index 487fb8f7..240ca2a2 100644 --- a/src/plugins/abrt-action-analyze-c.c +++ b/src/plugins/abrt-action-analyze-c.c @@ -21,24 +21,13 @@ static void create_hash(char hash_str[SHA1_RESULT_LEN*2 + 1], const char *pInput) { - unsigned char hash_bytes[SHA1_RESULT_LEN]; - + char hash_bytes[SHA1_RESULT_LEN]; sha1_ctx_t sha1ctx; sha1_begin(&sha1ctx); sha1_hash(&sha1ctx, pInput, strlen(pInput)); sha1_end(&sha1ctx, hash_bytes); - unsigned len = SHA1_RESULT_LEN; - unsigned char *s = hash_bytes; - char *d = hash_str; - while (len) - { - *d++ = "0123456789abcdef"[*s >> 4]; - *d++ = "0123456789abcdef"[*s & 0xf]; - s++; - len--; - } - *d = '\0'; + bin2hex(hash_str, hash_bytes, SHA1_RESULT_LEN)[0] = '\0'; //log("hash:%s str:'%s'", hash_str, pInput); } -- cgit