aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2021-04-21 17:45:27 +0000
committerEd Maste <emaste@FreeBSD.org>2021-04-28 00:12:06 +0000
commit8e64d97d94f7a1ad186c1168e905f18eb2fe5f8b (patch)
treee5436b59ffc09b72bffa494331a60d031aff700a
parentb2cb7574420ed01f7b3ef99cade7b5dd935b9890 (diff)
downloadsrc-8e64d97d94f7a1ad186c1168e905f18eb2fe5f8b.tar.gz
src-8e64d97d94f7a1ad186c1168e905f18eb2fe5f8b.zip
libkiconv: address memory leak in not-found cases
Found in "Understanding and Detecting Disordered Error Handling with Precise Function Pairing" by Qiushi Wu et al. Reviewed by: imp, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29896 (cherry picked from commit 3cfd08c1c74058451a02bac35307bf7fa509c617)
-rw-r--r--lib/libkiconv/kiconv_sysctl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libkiconv/kiconv_sysctl.c b/lib/libkiconv/kiconv_sysctl.c
index 7eebf2b4e0c7..bc2e3341ab0b 100644
--- a/lib/libkiconv/kiconv_sysctl.c
+++ b/lib/libkiconv/kiconv_sysctl.c
@@ -57,6 +57,7 @@ kiconv_lookupconv(const char *drvname)
free(drivers);
return (0);
}
+ free(drivers);
}
return (ENOENT);
}
@@ -84,6 +85,7 @@ kiconv_lookupcs(const char *tocode, const char *fromcode)
return (0);
}
}
+ free(csi);
}
return (ENOENT);
}