summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Kramlich <grim@reaperworld.com>2021-06-03 20:18:38 -0500
committerGary Kramlich <grim@reaperworld.com>2021-06-03 20:18:38 -0500
commita561c6fa93a5c8f69764522bae0d50e68105e2e8 (patch)
tree364d6c1cff91731523ea415050f86cedf44ec9da
parentdd40e8f10da917b8a744f7c4158fae90d5a90289 (diff)
downloadpidgin-a561c6fa93a5c8f69764522bae0d50e68105e2e8.tar.gz
Zero out some memory that scanbuild thought might be used
Testing Done: Verified that scanbuild no longer detected the errors. Reviewed at https://reviews.imfreedom.org/r/716/
-rw-r--r--libpurple/desktopitem.c2
-rw-r--r--pidgin/gtksourceiter.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/libpurple/desktopitem.c b/libpurple/desktopitem.c
index fb371d2f6a..da0d726fc3 100644
--- a/libpurple/desktopitem.c
+++ b/libpurple/desktopitem.c
@@ -340,7 +340,7 @@ static Encoding
get_encoding (FILE *df)
{
gboolean old_kde = FALSE;
- char buf [BUFSIZ];
+ char buf [BUFSIZ] = { 0 };
gboolean all_valid_utf8 = TRUE;
while (my_fgets (buf, sizeof (buf), df) != NULL) {
diff --git a/pidgin/gtksourceiter.c b/pidgin/gtksourceiter.c
index 050f683c43..628baf7467 100644
--- a/pidgin/gtksourceiter.c
+++ b/pidgin/gtksourceiter.c
@@ -513,7 +513,7 @@ strbreakup (const char *string,
string_list = g_slist_prepend (string_list, new_string);
}
- str_array = g_new (gchar*, n);
+ str_array = g_new0(gchar*, n);
i = n - 1;