Skip to content

Commit

Permalink
Please rchk tool
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Nov 20, 2024
1 parent ebadcee commit c7b5ad1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ void assert_message(CURLcode res, const char *str){
SEXP message = PROTECT(make_string(str));
SEXP expr = PROTECT(Rf_install("raise_libcurl_error"));
SEXP call = PROTECT(Rf_lang3(expr, code, message));
Rf_eval(call, R_FindNamespace(Rf_mkString("curl")));
UNPROTECT(4);
SEXP env = PROTECT(R_FindNamespace(Rf_mkString("curl")));
Rf_eval(call, env);
UNPROTECT(5); //never happens
}

void assert_status(CURLcode res, reference *ref){
Expand All @@ -61,8 +62,9 @@ void assert_status(CURLcode res, reference *ref){
SEXP errbuf = PROTECT(make_string(ref->errbuf));
SEXP expr = PROTECT(Rf_install("raise_libcurl_error"));
SEXP call = PROTECT(Rf_lang5(expr, code, message, errbuf, url));
Rf_eval(call, R_FindNamespace(Rf_mkString("curl")));
UNPROTECT(6);
SEXP env = PROTECT(R_FindNamespace(Rf_mkString("curl")));
Rf_eval(call, env);
UNPROTECT(7); //never happens
}

void massert(CURLMcode res){
Expand Down

0 comments on commit c7b5ad1

Please sign in to comment.