Uploaded image for project: 'Axis2-C'
  1. Axis2-C
  2. AXIS2C-1305

error not set when memory allocation fails in axis2_stub_start_op_... generated code

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • None
    • code generation
    • None
    • Win

    Description

      In the axis2_stub_start_op_... generated code, the error fields are not set when memory allocation fails. The using code will assume the call succeeded because no error is set, while it actually failed (although out-of-mem is hopefully a rare situation).
      See example code from the calculator example:

      void AXIS2_CALL
      axis2_stub_start_op_Calculator_add( axis2_stub_t *stub, const axutil_env_t *env,

      :
      :
      callback_data = (struct axis2_stub_Calculator_add_callback_data*) AXIS2_MALLOC(env->allocator,
      sizeof(struct axis2_stub_Calculator_add_callback_data));
      if(NULL == callback_data)

      { AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); // <=== This line was not there! AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "Can not allocate memeory for the callback data structures"); return; }

      Attachments

        1. mem-error.diff
          0.8 kB
          Patrick van Beem

        Activity

          People

            Unassigned Unassigned
            pvbeem Patrick van Beem
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified