merge from gcc
This commit is contained in:
parent
e7782cf63b
commit
4ff224cb8d
@ -1,3 +1,12 @@
|
|||||||
|
2011-04-20 Jim Meyering <meyering@redhat.com>
|
||||||
|
|
||||||
|
* decNumber.c (decNumberFromString): Remove useless
|
||||||
|
if-before-free test.
|
||||||
|
(decNumberCompareTotalMag, decNumberExp, decNumberFMA): Likewise.
|
||||||
|
(decNumberLn, decNumberLog10, decNumberPower): Likewise.
|
||||||
|
(decNumberReduce, decNumberSquareRoot, decAddOp): Likewise.
|
||||||
|
(decDivideOp, NEEDTWO, decExpOp, LN2): Likewise.
|
||||||
|
|
||||||
2011-03-28 Mike Frysinger <vapier@gentoo.org>
|
2011-03-28 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
* .gitignore: New file.
|
* .gitignore: New file.
|
||||||
|
@ -711,7 +711,7 @@ decNumber * decNumberFromString(decNumber *dn, const char chars[],
|
|||||||
/* decNumberShow(dn); */
|
/* decNumberShow(dn); */
|
||||||
} while(0); /* [for break] */
|
} while(0); /* [for break] */
|
||||||
|
|
||||||
if (allocres!=NULL) free(allocres); /* drop any storage used */
|
free(allocres); /* drop any storage used */
|
||||||
if (status!=0) decStatus(dn, status, set);
|
if (status!=0) decStatus(dn, status, set);
|
||||||
return dn;
|
return dn;
|
||||||
} /* decNumberFromString */
|
} /* decNumberFromString */
|
||||||
@ -970,8 +970,8 @@ decNumber * decNumberCompareTotalMag(decNumber *res, const decNumber *lhs,
|
|||||||
decCompareOp(res, lhs, rhs, set, COMPTOTAL, &status);
|
decCompareOp(res, lhs, rhs, set, COMPTOTAL, &status);
|
||||||
} while(0); /* end protected */
|
} while(0); /* end protected */
|
||||||
|
|
||||||
if (allocbufa!=NULL) free(allocbufa); /* drop any storage used */
|
free(allocbufa); /* drop any storage used */
|
||||||
if (allocbufb!=NULL) free(allocbufb); /* .. */
|
free(allocbufb); /* .. */
|
||||||
if (status!=0) decStatus(res, status, set);
|
if (status!=0) decStatus(res, status, set);
|
||||||
return res;
|
return res;
|
||||||
} /* decNumberCompareTotalMag */
|
} /* decNumberCompareTotalMag */
|
||||||
@ -1074,7 +1074,7 @@ decNumber * decNumberExp(decNumber *res, const decNumber *rhs,
|
|||||||
} while(0); /* end protected */
|
} while(0); /* end protected */
|
||||||
|
|
||||||
#if DECSUBSET
|
#if DECSUBSET
|
||||||
if (allocrhs !=NULL) free(allocrhs); /* drop any storage used */
|
free(allocrhs); /* drop any storage used */
|
||||||
#endif
|
#endif
|
||||||
/* apply significant status */
|
/* apply significant status */
|
||||||
if (status!=0) decStatus(res, status, set);
|
if (status!=0) decStatus(res, status, set);
|
||||||
@ -1169,7 +1169,7 @@ decNumber * decNumberFMA(decNumber *res, const decNumber *lhs,
|
|||||||
decAddOp(res, acc, fhs, set, 0, &status);
|
decAddOp(res, acc, fhs, set, 0, &status);
|
||||||
} while(0); /* end protected */
|
} while(0); /* end protected */
|
||||||
|
|
||||||
if (allocbufa!=NULL) free(allocbufa); /* drop any storage used */
|
free(allocbufa); /* drop any storage used */
|
||||||
if (status!=0) decStatus(res, status, set);
|
if (status!=0) decStatus(res, status, set);
|
||||||
#if DECCHECK
|
#if DECCHECK
|
||||||
decCheckInexact(res, set);
|
decCheckInexact(res, set);
|
||||||
@ -1296,7 +1296,7 @@ decNumber * decNumberLn(decNumber *res, const decNumber *rhs,
|
|||||||
} while(0); /* end protected */
|
} while(0); /* end protected */
|
||||||
|
|
||||||
#if DECSUBSET
|
#if DECSUBSET
|
||||||
if (allocrhs !=NULL) free(allocrhs); /* drop any storage used */
|
free(allocrhs); /* drop any storage used */
|
||||||
#endif
|
#endif
|
||||||
/* apply significant status */
|
/* apply significant status */
|
||||||
if (status!=0) decStatus(res, status, set);
|
if (status!=0) decStatus(res, status, set);
|
||||||
@ -1509,10 +1509,10 @@ decNumber * decNumberLog10(decNumber *res, const decNumber *rhs,
|
|||||||
decDivideOp(res, a, b, &aset, DIVIDE, &status); /* into result */
|
decDivideOp(res, a, b, &aset, DIVIDE, &status); /* into result */
|
||||||
} while(0); /* [for break] */
|
} while(0); /* [for break] */
|
||||||
|
|
||||||
if (allocbufa!=NULL) free(allocbufa); /* drop any storage used */
|
free(allocbufa); /* drop any storage used */
|
||||||
if (allocbufb!=NULL) free(allocbufb); /* .. */
|
free(allocbufb); /* .. */
|
||||||
#if DECSUBSET
|
#if DECSUBSET
|
||||||
if (allocrhs !=NULL) free(allocrhs); /* .. */
|
free(allocrhs); /* .. */
|
||||||
#endif
|
#endif
|
||||||
/* apply significant status */
|
/* apply significant status */
|
||||||
if (status!=0) decStatus(res, status, set);
|
if (status!=0) decStatus(res, status, set);
|
||||||
@ -2253,11 +2253,11 @@ decNumber * decNumberPower(decNumber *res, const decNumber *lhs,
|
|||||||
#endif
|
#endif
|
||||||
} while(0); /* end protected */
|
} while(0); /* end protected */
|
||||||
|
|
||||||
if (allocdac!=NULL) free(allocdac); /* drop any storage used */
|
free(allocdac); /* drop any storage used */
|
||||||
if (allocinv!=NULL) free(allocinv); /* .. */
|
free(allocinv); /* .. */
|
||||||
#if DECSUBSET
|
#if DECSUBSET
|
||||||
if (alloclhs!=NULL) free(alloclhs); /* .. */
|
free(alloclhs); /* .. */
|
||||||
if (allocrhs!=NULL) free(allocrhs); /* .. */
|
free(allocrhs); /* .. */
|
||||||
#endif
|
#endif
|
||||||
if (status!=0) decStatus(res, status, set);
|
if (status!=0) decStatus(res, status, set);
|
||||||
#if DECCHECK
|
#if DECCHECK
|
||||||
@ -2349,7 +2349,7 @@ decNumber * decNumberReduce(decNumber *res, const decNumber *rhs,
|
|||||||
} while(0); /* end protected */
|
} while(0); /* end protected */
|
||||||
|
|
||||||
#if DECSUBSET
|
#if DECSUBSET
|
||||||
if (allocrhs !=NULL) free(allocrhs); /* .. */
|
free(allocrhs); /* .. */
|
||||||
#endif
|
#endif
|
||||||
if (status!=0) decStatus(res, status, set);/* then report status */
|
if (status!=0) decStatus(res, status, set);/* then report status */
|
||||||
return res;
|
return res;
|
||||||
@ -3111,11 +3111,11 @@ decNumber * decNumberSquareRoot(decNumber *res, const decNumber *rhs,
|
|||||||
decNumberCopy(res, a); /* a is now the result */
|
decNumberCopy(res, a); /* a is now the result */
|
||||||
} while(0); /* end protected */
|
} while(0); /* end protected */
|
||||||
|
|
||||||
if (allocbuff!=NULL) free(allocbuff); /* drop any storage used */
|
free(allocbuff); /* drop any storage used */
|
||||||
if (allocbufa!=NULL) free(allocbufa); /* .. */
|
free(allocbufa); /* .. */
|
||||||
if (allocbufb!=NULL) free(allocbufb); /* .. */
|
free(allocbufb); /* .. */
|
||||||
#if DECSUBSET
|
#if DECSUBSET
|
||||||
if (allocrhs !=NULL) free(allocrhs); /* .. */
|
free(allocrhs); /* .. */
|
||||||
#endif
|
#endif
|
||||||
if (status!=0) decStatus(res, status, set);/* then report status */
|
if (status!=0) decStatus(res, status, set);/* then report status */
|
||||||
#if DECCHECK
|
#if DECCHECK
|
||||||
@ -4130,10 +4130,10 @@ static decNumber * decAddOp(decNumber *res, const decNumber *lhs,
|
|||||||
}
|
}
|
||||||
} while(0); /* end protected */
|
} while(0); /* end protected */
|
||||||
|
|
||||||
if (allocacc!=NULL) free(allocacc); /* drop any storage used */
|
free(allocacc); /* drop any storage used */
|
||||||
#if DECSUBSET
|
#if DECSUBSET
|
||||||
if (allocrhs!=NULL) free(allocrhs); /* .. */
|
free(allocrhs); /* .. */
|
||||||
if (alloclhs!=NULL) free(alloclhs); /* .. */
|
free(alloclhs); /* .. */
|
||||||
#endif
|
#endif
|
||||||
return res;
|
return res;
|
||||||
} /* decAddOp */
|
} /* decAddOp */
|
||||||
@ -4782,11 +4782,11 @@ static decNumber * decDivideOp(decNumber *res,
|
|||||||
#endif
|
#endif
|
||||||
} while(0); /* end protected */
|
} while(0); /* end protected */
|
||||||
|
|
||||||
if (varalloc!=NULL) free(varalloc); /* drop any storage used */
|
free(varalloc); /* drop any storage used */
|
||||||
if (allocacc!=NULL) free(allocacc); /* .. */
|
free(allocacc); /* .. */
|
||||||
#if DECSUBSET
|
#if DECSUBSET
|
||||||
if (allocrhs!=NULL) free(allocrhs); /* .. */
|
free(allocrhs); /* .. */
|
||||||
if (alloclhs!=NULL) free(alloclhs); /* .. */
|
free(alloclhs); /* .. */
|
||||||
#endif
|
#endif
|
||||||
return res;
|
return res;
|
||||||
} /* decDivideOp */
|
} /* decDivideOp */
|
||||||
@ -5127,14 +5127,14 @@ static decNumber * decMultiplyOp(decNumber *res, const decNumber *lhs,
|
|||||||
decFinish(res, set, &residue, status); /* final cleanup */
|
decFinish(res, set, &residue, status); /* final cleanup */
|
||||||
} while(0); /* end protected */
|
} while(0); /* end protected */
|
||||||
|
|
||||||
if (allocacc!=NULL) free(allocacc); /* drop any storage used */
|
free(allocacc); /* drop any storage used */
|
||||||
#if DECSUBSET
|
#if DECSUBSET
|
||||||
if (allocrhs!=NULL) free(allocrhs); /* .. */
|
free(allocrhs); /* .. */
|
||||||
if (alloclhs!=NULL) free(alloclhs); /* .. */
|
free(alloclhs); /* .. */
|
||||||
#endif
|
#endif
|
||||||
#if FASTMUL
|
#if FASTMUL
|
||||||
if (allocrhi!=NULL) free(allocrhi); /* .. */
|
free(allocrhi); /* .. */
|
||||||
if (alloclhi!=NULL) free(alloclhi); /* .. */
|
free(alloclhi); /* .. */
|
||||||
#endif
|
#endif
|
||||||
return res;
|
return res;
|
||||||
} /* decMultiplyOp */
|
} /* decMultiplyOp */
|
||||||
@ -5483,9 +5483,9 @@ decNumber * decExpOp(decNumber *res, const decNumber *rhs,
|
|||||||
decFinish(res, set, &residue, status); /* cleanup/set flags */
|
decFinish(res, set, &residue, status); /* cleanup/set flags */
|
||||||
} while(0); /* end protected */
|
} while(0); /* end protected */
|
||||||
|
|
||||||
if (allocrhs !=NULL) free(allocrhs); /* drop any storage used */
|
free(allocrhs); /* drop any storage used */
|
||||||
if (allocbufa!=NULL) free(allocbufa); /* .. */
|
free(allocbufa); /* .. */
|
||||||
if (allocbuft!=NULL) free(allocbuft); /* .. */
|
free(allocbuft); /* .. */
|
||||||
/* [status is handled by caller] */
|
/* [status is handled by caller] */
|
||||||
return res;
|
return res;
|
||||||
} /* decExpOp */
|
} /* decExpOp */
|
||||||
@ -5794,8 +5794,8 @@ decNumber * decLnOp(decNumber *res, const decNumber *rhs,
|
|||||||
decFinish(res, set, &residue, status); /* cleanup/set flags */
|
decFinish(res, set, &residue, status); /* cleanup/set flags */
|
||||||
} while(0); /* end protected */
|
} while(0); /* end protected */
|
||||||
|
|
||||||
if (allocbufa!=NULL) free(allocbufa); /* drop any storage used */
|
free(allocbufa); /* drop any storage used */
|
||||||
if (allocbufb!=NULL) free(allocbufb); /* .. */
|
free(allocbufb); /* .. */
|
||||||
/* [status is handled by caller] */
|
/* [status is handled by caller] */
|
||||||
return res;
|
return res;
|
||||||
} /* decLnOp */
|
} /* decLnOp */
|
||||||
@ -5959,8 +5959,8 @@ static decNumber * decQuantizeOp(decNumber *res, const decNumber *lhs,
|
|||||||
} while(0); /* end protected */
|
} while(0); /* end protected */
|
||||||
|
|
||||||
#if DECSUBSET
|
#if DECSUBSET
|
||||||
if (allocrhs!=NULL) free(allocrhs); /* drop any storage used */
|
free(allocrhs); /* drop any storage used */
|
||||||
if (alloclhs!=NULL) free(alloclhs); /* .. */
|
free(alloclhs); /* .. */
|
||||||
#endif
|
#endif
|
||||||
return res;
|
return res;
|
||||||
} /* decQuantizeOp */
|
} /* decQuantizeOp */
|
||||||
@ -6142,8 +6142,8 @@ decNumber * decCompareOp(decNumber *res, const decNumber *lhs,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if DECSUBSET
|
#if DECSUBSET
|
||||||
if (allocrhs!=NULL) free(allocrhs); /* free any storage used */
|
free(allocrhs); /* free any storage used */
|
||||||
if (alloclhs!=NULL) free(alloclhs); /* .. */
|
free(alloclhs); /* .. */
|
||||||
#endif
|
#endif
|
||||||
return res;
|
return res;
|
||||||
} /* decCompareOp */
|
} /* decCompareOp */
|
||||||
@ -6277,7 +6277,7 @@ static Int decUnitCompare(const Unit *a, Int alength,
|
|||||||
result=(*u==0 ? 0 : +1);
|
result=(*u==0 ? 0 : +1);
|
||||||
}
|
}
|
||||||
/* clean up and return the result */
|
/* clean up and return the result */
|
||||||
if (allocacc!=NULL) free(allocacc); /* drop any storage used */
|
free(allocacc); /* drop any storage used */
|
||||||
return result;
|
return result;
|
||||||
} /* decUnitCompare */
|
} /* decUnitCompare */
|
||||||
|
|
||||||
|
@ -1,3 +1,16 @@
|
|||||||
|
2011-04-20 Jim Meyering <meyering@redhat.com>
|
||||||
|
|
||||||
|
* cp-demint.c (cplus_demangle_v3_components): Remove useless
|
||||||
|
if-before-free.
|
||||||
|
* cplus-dem.c (squangle_mop_up): Likewise.
|
||||||
|
(delete_non_B_K_work_stuff): Likewise.
|
||||||
|
* pex-common.c (pex_free): Likewise.
|
||||||
|
* pex-msdos.c (pex_msdos_cleanup): Likewise.
|
||||||
|
* pex-win32.c (mingw_rootify, msys_rootify): Likewise.
|
||||||
|
(win32_spawn): Likewise.
|
||||||
|
* regex.c (FREE_VAR, weak_alias): Likewise.
|
||||||
|
* spaces.c (spaces): Likewise.
|
||||||
|
|
||||||
2011-04-10 Jim Meyering <meyering@redhat.com>
|
2011-04-10 Jim Meyering <meyering@redhat.com>
|
||||||
|
|
||||||
Avoid memory overrun in a test leading to potential double-free.
|
Avoid memory overrun in a test leading to potential double-free.
|
||||||
|
@ -206,10 +206,8 @@ cplus_demangle_v3_components (const char *mangled, int options, void **mem)
|
|||||||
malloc (di.num_subs * sizeof (struct demangle_component *)));
|
malloc (di.num_subs * sizeof (struct demangle_component *)));
|
||||||
if (di.comps == NULL || di.subs == NULL)
|
if (di.comps == NULL || di.subs == NULL)
|
||||||
{
|
{
|
||||||
if (di.comps != NULL)
|
free (di.comps);
|
||||||
free (di.comps);
|
free (di.subs);
|
||||||
if (di.subs != NULL)
|
|
||||||
free (di.subs);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1311,8 +1311,7 @@ delete_non_B_K_work_stuff (struct work_stuff *work)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < work->ntmpl_args; i++)
|
for (i = 0; i < work->ntmpl_args; i++)
|
||||||
if (work->tmpl_argvec[i])
|
free ((char*) work->tmpl_argvec[i]);
|
||||||
free ((char*) work->tmpl_argvec[i]);
|
|
||||||
|
|
||||||
free ((char*) work->tmpl_argvec);
|
free ((char*) work->tmpl_argvec);
|
||||||
work->tmpl_argvec = NULL;
|
work->tmpl_argvec = NULL;
|
||||||
|
@ -623,12 +623,9 @@ pex_free (struct pex_obj *obj)
|
|||||||
|
|
||||||
if (obj->next_input_name_allocated)
|
if (obj->next_input_name_allocated)
|
||||||
free (obj->next_input_name);
|
free (obj->next_input_name);
|
||||||
if (obj->children != NULL)
|
free (obj->children);
|
||||||
free (obj->children);
|
free (obj->status);
|
||||||
if (obj->status != NULL)
|
free (obj->time);
|
||||||
free (obj->status);
|
|
||||||
if (obj->time != NULL)
|
|
||||||
free (obj->time);
|
|
||||||
|
|
||||||
if (obj->remove_count > 0)
|
if (obj->remove_count > 0)
|
||||||
{
|
{
|
||||||
|
@ -310,10 +310,8 @@ pex_msdos_cleanup (struct pex_obj *obj)
|
|||||||
|
|
||||||
ms = (struct pex_msdos *) obj->sysdep;
|
ms = (struct pex_msdos *) obj->sysdep;
|
||||||
for (i = 0; i < PEX_MSDOS_FILE_COUNT; ++i)
|
for (i = 0; i < PEX_MSDOS_FILE_COUNT; ++i)
|
||||||
if (msdos->files[i] != NULL)
|
free (msdos->files[i]);
|
||||||
free (msdos->files[i]);
|
free (msdos->statuses);
|
||||||
if (msdos->statuses != NULL)
|
|
||||||
free (msdos->statuses);
|
|
||||||
free (msdos);
|
free (msdos);
|
||||||
obj->sysdep = NULL;
|
obj->sysdep = NULL;
|
||||||
}
|
}
|
||||||
|
@ -210,10 +210,8 @@ mingw_rootify (const char *executable)
|
|||||||
if (!namebuf || !foundbuf)
|
if (!namebuf || !foundbuf)
|
||||||
{
|
{
|
||||||
RegCloseKey (hKey);
|
RegCloseKey (hKey);
|
||||||
if (namebuf)
|
free (namebuf);
|
||||||
free (namebuf);
|
free (foundbuf);
|
||||||
if (foundbuf)
|
|
||||||
free (foundbuf);
|
|
||||||
return executable;
|
return executable;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -315,8 +313,7 @@ msys_rootify (const char *executable)
|
|||||||
return tack_on_executable (buf, executable);
|
return tack_on_executable (buf, executable);
|
||||||
|
|
||||||
/* failed */
|
/* failed */
|
||||||
if (buf)
|
free (buf);
|
||||||
free (buf);
|
|
||||||
return executable;
|
return executable;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -607,8 +604,7 @@ win32_spawn (const char *executable,
|
|||||||
si,
|
si,
|
||||||
pi))
|
pi))
|
||||||
{
|
{
|
||||||
if (env_block)
|
free (env_block);
|
||||||
free (env_block);
|
|
||||||
|
|
||||||
free (full_executable);
|
free (full_executable);
|
||||||
|
|
||||||
@ -618,18 +614,14 @@ win32_spawn (const char *executable,
|
|||||||
/* Clean up. */
|
/* Clean up. */
|
||||||
CloseHandle (pi->hThread);
|
CloseHandle (pi->hThread);
|
||||||
free (full_executable);
|
free (full_executable);
|
||||||
if (env_block)
|
free (env_block);
|
||||||
free (env_block);
|
|
||||||
|
|
||||||
return (pid_t) pi->hProcess;
|
return (pid_t) pi->hProcess;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
if (env_block)
|
free (env_block);
|
||||||
free (env_block);
|
free (cmdline);
|
||||||
if (cmdline)
|
free (full_executable);
|
||||||
free (cmdline);
|
|
||||||
if (full_executable)
|
|
||||||
free (full_executable);
|
|
||||||
|
|
||||||
return (pid_t) -1;
|
return (pid_t) -1;
|
||||||
}
|
}
|
||||||
|
@ -4970,7 +4970,7 @@ weak_alias (__re_search_2, re_search_2)
|
|||||||
#ifdef MATCH_MAY_ALLOCATE
|
#ifdef MATCH_MAY_ALLOCATE
|
||||||
# define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL
|
# define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL
|
||||||
#else
|
#else
|
||||||
# define FREE_VAR(var) if (var) free (var); var = NULL
|
# define FREE_VAR(var) free (var); var = NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WCHAR
|
#ifdef WCHAR
|
||||||
@ -8111,20 +8111,17 @@ weak_alias (__regerror, regerror)
|
|||||||
void
|
void
|
||||||
regfree (regex_t *preg)
|
regfree (regex_t *preg)
|
||||||
{
|
{
|
||||||
if (preg->buffer != NULL)
|
free (preg->buffer);
|
||||||
free (preg->buffer);
|
|
||||||
preg->buffer = NULL;
|
preg->buffer = NULL;
|
||||||
|
|
||||||
preg->allocated = 0;
|
preg->allocated = 0;
|
||||||
preg->used = 0;
|
preg->used = 0;
|
||||||
|
|
||||||
if (preg->fastmap != NULL)
|
free (preg->fastmap);
|
||||||
free (preg->fastmap);
|
|
||||||
preg->fastmap = NULL;
|
preg->fastmap = NULL;
|
||||||
preg->fastmap_accurate = 0;
|
preg->fastmap_accurate = 0;
|
||||||
|
|
||||||
if (preg->translate != NULL)
|
free (preg->translate);
|
||||||
free (preg->translate);
|
|
||||||
preg->translate = NULL;
|
preg->translate = NULL;
|
||||||
}
|
}
|
||||||
#ifdef _LIBC
|
#ifdef _LIBC
|
||||||
|
@ -53,10 +53,7 @@ spaces (int count)
|
|||||||
|
|
||||||
if (count > maxsize)
|
if (count > maxsize)
|
||||||
{
|
{
|
||||||
if (buf)
|
free (buf);
|
||||||
{
|
|
||||||
free (buf);
|
|
||||||
}
|
|
||||||
buf = (char *) malloc (count + 1);
|
buf = (char *) malloc (count + 1);
|
||||||
if (buf == (char *) 0)
|
if (buf == (char *) 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user