mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
mmc-utils: update to latest git head
Also add some valueable patches from mailing-list - upstream seems not to care so much about, but giving them a broader audience does not hurt. Signed-off-by: Michael Heimpold <mhei@heimpold.de>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
From 9214f2a4002bafef73c9593464ab3841ba7bac12 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Heimpold <michael.heimpold@i2se.com>
|
||||
Date: Tue, 18 Dec 2018 14:49:37 +0100
|
||||
Subject: [PATCH 2/9] Cleanup memory in error case
|
||||
|
||||
In case that we leave due to malformed string,
|
||||
free the allocated memory before returning.
|
||||
|
||||
Signed-off-by: Michael Heimpold <michael.heimpold@i2se.com>
|
||||
Cc: Michael Heimpold <mhei@heimpold.de>
|
||||
---
|
||||
lsmmc.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lsmmc.c b/lsmmc.c
|
||||
index e514c83..a53bc57 100644
|
||||
--- a/lsmmc.c
|
||||
+++ b/lsmmc.c
|
||||
@@ -378,8 +378,10 @@ char *to_binstr(char *hexstr)
|
||||
return NULL;
|
||||
|
||||
while (hexstr && *hexstr != '\0') {
|
||||
- if (!isxdigit(*hexstr))
|
||||
+ if (!isxdigit(*hexstr)) {
|
||||
+ free(binstr);
|
||||
return NULL;
|
||||
+ }
|
||||
|
||||
if (isdigit(*hexstr))
|
||||
strcat(binstr, bindigits[*hexstr - '0']);
|
||||
--
|
||||
2.17.1
|
||||
|
||||
Reference in New Issue
Block a user