notaz.gp2x.de
/
picodrive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d1b8bcc
)
fix underalloc
author
notaz
<notasas@gmail.com>
Sat, 30 Sep 2017 23:42:24 +0000
(
02:42
+0300)
committer
notaz
<notasas@gmail.com>
Fri, 6 Oct 2017 22:36:59 +0000
(
01:36
+0300)
pico/sek.c
patch
|
blob
|
blame
|
history
diff --git
a/pico/sek.c
b/pico/sek.c
index
8bf0341
..
5176528
100644
(file)
--- a/
pico/sek.c
+++ b/
pico/sek.c
@@
-302,7
+302,8
@@
void SekRegisterIdleHit(unsigned int pc)
\r
void SekInitIdleDet(void)
\r
{
\r
\r
void SekInitIdleDet(void)
\r
{
\r
- unsigned short **tmp = realloc(idledet_ptrs, 0x200*4);
\r
+ unsigned short **tmp;
\r
+ tmp = realloc(idledet_ptrs, 0x200 * sizeof(tmp[0]));
\r
if (tmp == NULL) {
\r
free(idledet_ptrs);
\r
idledet_ptrs = NULL;
\r
if (tmp == NULL) {
\r
free(idledet_ptrs);
\r
idledet_ptrs = NULL;
\r
@@
-410,7
+411,8
@@
int SekRegisterIdlePatch(unsigned int pc, int oldop, int newop, void *ctx)
}
\r
\r
if (idledet_count >= 0x200 && (idledet_count & 0x1ff) == 0) {
\r
}
\r
\r
if (idledet_count >= 0x200 && (idledet_count & 0x1ff) == 0) {
\r
- unsigned short **tmp = realloc(idledet_ptrs, (idledet_count+0x200)*4);
\r
+ unsigned short **tmp;
\r
+ tmp = realloc(idledet_ptrs, (idledet_count+0x200) * sizeof(tmp[0]));
\r
if (tmp == NULL)
\r
return 1;
\r
idledet_ptrs = tmp;
\r
if (tmp == NULL)
\r
return 1;
\r
idledet_ptrs = tmp;
\r