summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorHaruna <haru@dotalux.com>2015-01-01 18:06:10 +0100
committerHaruna <haru@dotalux.com>2015-01-01 18:06:10 +0100
commitff607f15ec14783aed8c0cf2749ac8cbe6d0e7db (patch)
treee121e6c1e25ff47a26090437c937b022d2bfebc6 /src/map/script.c
parentdc6b470e4aaf252cb4f960b8b5585e51da821893 (diff)
parentf70d54001cd1b975db6f4668a6d54dbae7a8ac92 (diff)
downloadhercules-ff607f15ec14783aed8c0cf2749ac8cbe6d0e7db.tar.gz
hercules-ff607f15ec14783aed8c0cf2749ac8cbe6d0e7db.tar.bz2
hercules-ff607f15ec14783aed8c0cf2749ac8cbe6d0e7db.tar.xz
hercules-ff607f15ec14783aed8c0cf2749ac8cbe6d0e7db.zip
Merge pull request #425 from 4144/fixes
Different fixes after automatic checks
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 031dfc21b..7634b6c68 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -767,6 +767,7 @@ const char* parse_callfunc(const char* p, int require_paren, int is_custom)
char null_arg = '\0';
int func;
+ // is need add check for arg null pointer below?
func = script->add_word(p);
if( script->str_data[func].type == C_FUNC ) {
// buildin function
@@ -2593,10 +2594,11 @@ void* get_val2(struct script_state* st, int64 uid, struct reg_db *ref) {
**/
void script_array_ensure_zero(struct script_state *st, struct map_session_data *sd, int64 uid, struct reg_db *ref) {
const char *name = script->get_str(script_getvarid(uid));
+ // is here st can be null pointer and st->rid is wrong?
struct reg_db *src = script->array_src(st, sd ? sd : st->rid ? map->id2sd(st->rid) : NULL, name, ref);
struct script_array *sa = NULL;
bool insert = false;
-
+
if( sd && !st ) /* when sd comes, st isn't available */
insert = true;
else {
@@ -4385,7 +4387,7 @@ void do_final_script(void) {
aFree(script->hq[i].item);
}
}
- if( script->hqis ) {
+ if (script->hqis && script->hqi) {
for( i = 0; i < script->hqis; i++ ) {
if( script->hqi[i].item != NULL )
aFree(script->hqi[i].item);