From d5f589be4e7a03375c653dce457a006639a58d3e Mon Sep 17 00:00:00 2001 From: Frank Trampe Date: Tue, 7 Oct 2014 14:41:32 -0500 Subject: [PATCH 1/3] This fixes some copy and paste errors that Coverity discovered that I introduced in the recent groups.plist merge. --- fontforge/autowidth2.c | 4 ++-- fontforgeexe/kernclass.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fontforge/autowidth2.c b/fontforge/autowidth2.c index 4df2794043..612f2a9544 100644 --- a/fontforge/autowidth2.c +++ b/fontforge/autowidth2.c @@ -835,13 +835,13 @@ return; if (kc->firsts != NULL) { int tmppos; for (tmppos = 0; tmppos < kc->first_cnt; tmppos++) - if (kc->firsts[tmppos] != NULL) { free(kc->firsts); kc->firsts = NULL; } + if (kc->firsts[tmppos] != NULL) { free(kc->firsts[tmppos]); kc->firsts[tmppos] = NULL; } free(kc->firsts); kc->firsts = NULL; } if (kc->seconds != NULL) { int tmppos; for (tmppos = 0; tmppos < kc->second_cnt; tmppos++) - if (kc->seconds[tmppos] != NULL) { free(kc->seconds); kc->seconds = NULL; } + if (kc->seconds[tmppos] != NULL) { free(kc->seconds[tmppos]); kc->seconds[tmppos] = NULL; } free(kc->seconds); kc->seconds = NULL; } free(kc->offsets); diff --git a/fontforgeexe/kernclass.c b/fontforgeexe/kernclass.c index b23356924c..b6b4e6d762 100644 --- a/fontforgeexe/kernclass.c +++ b/fontforgeexe/kernclass.c @@ -2296,7 +2296,7 @@ static void KCD_RowMotion(GGadget *g,int oldr, int newr) { kcd->seconds_names[oldr] = kcd->seconds_names[newr]; kcd->seconds_names[newr] = name; } - if (kcd->firsts_flags) { + if (kcd->seconds_flags) { int flags = kcd->seconds_flags[oldr]; kcd->seconds_flags[oldr] = kcd->seconds_flags[newr]; kcd->seconds_flags[newr] = flags; @@ -2341,7 +2341,7 @@ static void KCD_DeleteClass(GGadget *g,int whichclass) { memmove(kcd->firsts_names+whichclass, kcd->firsts_names+whichclass + 1, (kcd->first_cnt - whichclass - 1) * sizeof(char*)); kcd->firsts_names = realloc(kcd->firsts_names, (kcd->first_cnt - 1) * sizeof(char*)); } - if (kcd->seconds_flags) { + if (kcd->firsts_flags) { memmove(kcd->firsts_flags+whichclass, kcd->firsts_flags+whichclass + 1, (kcd->first_cnt - whichclass - 1) * sizeof(int)); kcd->firsts_flags = realloc(kcd->firsts_flags, (kcd->first_cnt - 1) * sizeof(int)); } From ccb09741c8f4608b237219236c0c60f392f48928 Mon Sep 17 00:00:00 2001 From: Frank Trampe Date: Tue, 7 Oct 2014 14:54:34 -0500 Subject: [PATCH 2/3] Fix a missing return value. --- fontforge/ufo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fontforge/ufo.c b/fontforge/ufo.c index 489361861a..84d6caa9bd 100644 --- a/fontforge/ufo.c +++ b/fontforge/ufo.c @@ -1650,6 +1650,7 @@ int ufo_kerning_tree_attempt_insert(struct ufo_kerning_tree_session *session, co } } free(tmppairname); tmppairname = NULL; + return 0; } From 33e09f13fe22462e7bc9f8746ccf1577e6a19224 Mon Sep 17 00:00:00 2001 From: Frank Trampe Date: Wed, 8 Oct 2014 11:06:37 -0500 Subject: [PATCH 3/3] Fix more. --- fontforge/autowidth2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fontforge/autowidth2.c b/fontforge/autowidth2.c index 612f2a9544..4e2c4218d9 100644 --- a/fontforge/autowidth2.c +++ b/fontforge/autowidth2.c @@ -852,13 +852,13 @@ return; if (kc->firsts_names != NULL) { int tmppos; for (tmppos = 0; tmppos < kc->first_cnt; tmppos++) - if (kc->firsts_names[tmppos] != NULL) { free(kc->firsts_names); kc->firsts_names = NULL; } + if (kc->firsts_names[tmppos] != NULL) { free(kc->firsts_names[tmppos]); kc->firsts_names[tmppos] = NULL; } free(kc->firsts_names); kc->firsts_names = NULL; } if (kc->seconds_names != NULL) { int tmppos; for (tmppos = 0; tmppos < kc->second_cnt; tmppos++) - if (kc->seconds_names[tmppos] != NULL) { free(kc->seconds_names); kc->seconds_names = NULL; } + if (kc->seconds_names[tmppos] != NULL) { free(kc->seconds_names[tmppos]); kc->seconds_names[tmppos] = NULL; } free(kc->seconds_names); kc->seconds_names = NULL; } if (kc->firsts_flags != NULL) { free(kc->firsts_flags); kc->firsts_flags = NULL; }