Module: sip-router Branch: kamailio_3.0 Commit: fc9770f9a5f6b874680465d417d0359a19ebbad6 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fc9770f9...
Author: Henning Westerholt henning.westerholt@1und1.de Committer: Marius Zbihlei marius.zbihlei@1and1.ro Date: Thu May 20 15:46:58 2010 +0200
fix memset call, set the variable to zero, not to the size with length 0.. (cherry picked from commit 355636358c07b8da9b1fcd6d04cdaf337c9f730c)
---
cfg/cfg_script.c | 2 +- modules_k/xcap_client/xcap_functions.c | 2 +- rvalue.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/cfg/cfg_script.c b/cfg/cfg_script.c index 8804e40..611a038 100644 --- a/cfg/cfg_script.c +++ b/cfg/cfg_script.c @@ -112,7 +112,7 @@ cfg_script_var_t *new_cfg_script_var(char *gname, char *vname, unsigned int type
var = (cfg_script_var_t *)pkg_malloc(sizeof(cfg_script_var_t)); if (!var) goto error; - memset(var, sizeof(cfg_script_var_t), 0); + memset(var, 0, sizeof(cfg_script_var_t)); var->type = type;
/* add the variable to the group */ diff --git a/modules_k/xcap_client/xcap_functions.c b/modules_k/xcap_client/xcap_functions.c index 1d3cea6..ba049e4 100644 --- a/modules_k/xcap_client/xcap_functions.c +++ b/modules_k/xcap_client/xcap_functions.c @@ -531,7 +531,7 @@ char* send_http_get(char* path, unsigned int xcap_port, char* match_etag, { char* hdr_name= NULL; - memset(buf, 128* sizeof(char), 0); + memset(buf, 0, 128* sizeof(char)); match_header= buf; hdr_name= (match_type==IF_MATCH)?"If-Match":"If-None-Match"; diff --git a/rvalue.c b/rvalue.c index ef8dda0..22a7b2b 100644 --- a/rvalue.c +++ b/rvalue.c @@ -2441,7 +2441,7 @@ struct rval_expr* mk_rval_expr_v(enum rval_type rv_type, void* val, rve=pkg_malloc(sizeof(*rve)); if (rve==0) return 0; - memset(rve, sizeof(*rve), 0); + memset(rve, 0, sizeof(*rve)); flags=0; switch(rv_type){ case RV_INT: @@ -2515,7 +2515,7 @@ struct rval_expr* mk_rval_expr1(enum rval_expr_op op, struct rval_expr* rve1, ret=pkg_malloc(sizeof(*ret)); if (ret==0) return 0; - memset(ret, sizeof(*ret), 0); + memset(ret, 0, sizeof(*ret)); ret->op=op; ret->left.rve=rve1; if (pos) ret->fpos=*pos; @@ -2568,7 +2568,7 @@ struct rval_expr* mk_rval_expr2(enum rval_expr_op op, struct rval_expr* rve1, ret=pkg_malloc(sizeof(*ret)); if (ret==0) return 0; - memset(ret, sizeof(*ret), 0); + memset(ret, 0, sizeof(*ret)); ret->op=op; ret->left.rve=rve1; ret->right.rve=rve2;