cvs: php4 /ext/session session.c

From: Date: Wed, 06 Mar 2002 12:34:47 +0000
Subject: cvs: php4 /ext/session session.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-9729@lists.php.net to get a copy of this message
sas Wed Mar 6 07:34:47 2002 EDT Modified files: /php4/ext/session session.c Log: Do the estrdups after checking for parameter constraints. No real memory leaks though, because they are catched by the memory manager. Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.291 php4/ext/session/session.c:1.292 --- php4/ext/session/session.c:1.291 Wed Mar 6 07:12:39 2002 +++ php4/ext/session/session.c Wed Mar 6 07:34:47 2002 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: session.c,v 1.291 2002/03/06 12:12:39 sas Exp $ */ +/* $Id: session.c,v 1.292 2002/03/06 12:34:47 sas Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1046,10 +1046,10 @@ int ac = ZEND_NUM_ARGS(); char *old; - old = estrdup(PS(session_name)); - if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE) WRONG_PARAM_COUNT; + + old = estrdup(PS(session_name)); if (ac == 1) { convert_to_string_ex(p_name); @@ -1068,10 +1068,10 @@ int ac = ZEND_NUM_ARGS(); char *old; - old = safe_estrdup(PS(mod)->name); - if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE) WRONG_PARAM_COUNT; + + old = safe_estrdup(PS(mod)->name); if (ac == 1) { ps_module *tempmod; @@ -1132,10 +1132,10 @@ int ac = ZEND_NUM_ARGS(); char *old; - old = estrdup(PS(save_path)); - if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE) WRONG_PARAM_COUNT; + + old = estrdup(PS(save_path)); if (ac == 1) { convert_to_string_ex(p_name); @@ -1154,12 +1154,12 @@ int ac = ZEND_NUM_ARGS(); char *old = empty_string; - if (PS(id)) - old = estrdup(PS(id)); - if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE) WRONG_PARAM_COUNT; + if (PS(id)) + old = estrdup(PS(id)); + if (ac == 1) { convert_to_string_ex(p_name); if (PS(id)) efree(PS(id)); @@ -1178,10 +1178,10 @@ int ac = ZEND_NUM_ARGS(); char *old; - old = estrdup(PS(cache_limiter)); - if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_cache_limiter) == FAILURE) WRONG_PARAM_COUNT; + + old = estrdup(PS(cache_limiter)); if (ac == 1) { convert_to_string_ex(p_cache_limiter);

« previous php.cvs (#9729) next »