소스 검색

Fixed memleak when player's string variable is cleared

Signed-off-by: Cydh Ramdh <cydh@pservero.com>
Cydh Ramdh 8 년 전
부모
커밋
4753407d63
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      src/map/pc.c

+ 2 - 0
src/map/pc.c

@@ -9118,6 +9118,8 @@ int pc_setregistry_str(struct map_session_data *sd, int64 reg, const char *val)
 				script_array_update(&sd->regs, reg, false);
 			p->value = aStrdup(val);
 		} else {
+			if (p->value)
+				aFree(p->value);
 			p->value = NULL;
 			if( index )
 				script_array_update(&sd->regs, reg, true);