title: Isn't this code redundant taking into account C++ memory management?
body: <p>I'm a C++ newbie, so I don't truly understand how C++ manages memory. Isn't this code redundant?</p>
  <pre class="lang-cpp prettyprint-override"><code>void processData()
  {
      FILE* savedDataFile;
      char* savedData;
      try {
          savedDataFile = fopen(&quot;../savedData.dump&quot;, &quot;r&quot;);
          if (!savedDataFile)
              throw 0;
          savedData = (char*)malloc(0xf000);
          fread(savedData, 1, 0xf000, savedDataFile);
          fclose(savedDataFile);
          free(savedDataFile); // Do I really need this?
      }
      catch (int e) {
          try {
              fclose(savedDataFile); // Do I really need this?
          }
          catch (int e) {
          }
          free(savedDataFile); // Do I really need this?
          free(savedData); // Do I really need this?
          fprintf(stderr, &quot;Failed to load saved data from the previous dump.\n&quot;);
          exit(EXIT_FAILURE);
      }
      // Data processing... it may take a while.
      free(savedData); // Do I really need this? Taking into account that this's actually the end of the program, there's only returning of EXIT_SUCCESS in the main function after it.
  }
  
  int main()
  {
      // Some work... then the last function's called:
      processData();
      return EXIT_SUCCESS;
  }
  </code></pre>
  <p>I really don't like redundant code, so I want to make my code free from it. Thank you in advance for help.</p>