diff --git a/svr-chansession.c b/svr-chansession.c
index 5ddb8d444a407c3878ed0cfa3121cd5ffaea3ddc..03ac40ac7231aba187eeea3bd9f364b21dd8f5af 100644
--- a/svr-chansession.c
+++ b/svr-chansession.c
@@ -810,7 +810,7 @@ static void addchildpid(struct ChanSess *chansess, pid_t pid) {
 	/* need to increase size */
 	if (i == svr_ses.childpidsize) {
 		svr_ses.childpids = (struct ChildPid*)m_realloc(svr_ses.childpids,
-				sizeof(struct ChildPid) * svr_ses.childpidsize+1);
+				sizeof(struct ChildPid) * (svr_ses.childpidsize+1));
 		svr_ses.childpidsize++;
 	}