title: Crash when returning a char array from a function
body: <p>A freind and I are working together on an ESP32 webserver, and we have hit a wall. My buddie has pretty much given up on it, and I am less skilled than him.</p>
  <p>We have the following functions, which compile fine, but cause the ESP32 to crash.
  After lots of debugging I am pretty certain the crash occurs when trying to return <code>c</code></p>
  <pre><code>void handle_logs_view(String path){
      char** list = sdcard_list_files(path);
      for (int i=0;list[i]!=NULL;i++){
          Serial.println(list[i]);
      }
  }
  
  char** sdcard_list_files(String path){
    Serial.println(&quot;Listing files for &quot;+path);
    if (path.compareTo(&quot;/&quot;)){
        char* c[]={&quot;dir1&quot;,&quot;file1.log&quot;,&quot;file2.log&quot;,&quot;file3.log&quot;,&quot;file4.log&quot;,&quot;file5.log&quot;,NULL};
        return c;
    }
    return NULL;
  }
  #endif
  
  </code></pre>
  <p>The results from the exception decoder are as follows:</p>
  <pre><code>PC: 0x400d1d1b: handle_logs_view(String) at C:\Users\MickW\Downloads\Front_End-11_create_file_explorer\Front_End-11_create_file_explorer\sample_code\WIFITest/WIFITest.ino line 45
  EXCVADDR: 0x00000000
  
  Decoding stack results
  0x400d1d1b: handle_logs_view(String) at C:\Users\MickW\Downloads\Front_End-11_create_file_explorer\Front_End-11_create_file_explorer\sample_code\WIFITest/WIFITest.ino line 45
  0x400d1e7e: std::_Function_handler   &gt;::_M_invoke(const std::_Any_data &amp;) at C:\Users\MickW\AppData\Local\Temp\arduino_build_351256\sketch\WebServer.cpp line 32
  0x400d68ff: std::function ::operator()() const at c:\users\mickw\appdata\local\arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0\xtensa-esp32-elf\include\c++\5.2.0/functional line 2271
  0x400d69a5: FunctionRequestHandler::handle(WebServer&amp;, HTTPMethod, String) at C:\Users\MickW\Documents\Arduino\hardware\espressif\esp32\libraries\WebServer\src\detail/RequestHandlersImpl.h line 45
  0x400d6a12: WebServer::_handleRequest() at C:\Users\MickW\Documents\Arduino\hardware\espressif\esp32\libraries\WebServer\src\WebServer.cpp line 633
  0x400d6b8d: WebServer::handleClient() at C:\Users\MickW\Documents\Arduino\hardware\espressif\esp32\libraries\WebServer\src\WebServer.cpp line 314
  0x400d1d6e: loop() at C:\Users\MickW\Downloads\Front_End-11_create_file_explorer\Front_End-11_create_file_explorer\sample_code\WIFITest/WIFITest.ino line 22
  0x400d8ad5: loopTask(void*) at C:\Users\MickW\Documents\Arduino\hardware\espressif\esp32\cores\esp32\main.cpp line 23
  0x40089552: vPortTaskWrapper at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/freertos/port.c line 143
  
  </code></pre>
  <p>This is from the espressif website:</p>
  <p>LoadProhibited, StoreProhibited<br />
  This CPU exception happens when application attempts to read from or write to an invalid memory location. The address which was written/read is found in EXCVADDR register in the register dump. If this address is zero, it usually means that application attempted to dereference a NULL pointer.</p>
  <p>I would be greatful for any help or advice</p>