title: SIGSEGV when reading config with libconfig
body: <p>I can't retrieve the user value from my config file using C and libconfig.</p>
  
  <p><strong>configreader.h</strong></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;libconfig.h&gt;
  #ifndef CONFIGREADER_H_INCLUDED
  #define CONFIGREADER_H_INCLUDED
  
  char *userreader(){
      static const char *inputfile = "/opt/plaininc/config/handler.conf";
      config_t configreader;
      const char *userconfig;
      if(! config_read_file(&amp;configreader, inputfile)){
          config_destroy(&amp;configreader);
          exit(EXIT_FAILURE);
  
      }
      if (config_lookup_string(&amp;configreader, "handler.user", &amp;userconfig)){
          config_destroy(&amp;configreader);
          return userconfig;
  
      } else {
          config_destroy(&amp;configreader);
          exit(EXIT_FAILURE);
  
      }
  }
  
  #endif
  </code></pre>
  
  <p><strong>CONFIG.c</strong></p>
  
  <pre><code>    #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include "configreader.h"
  
  int main(){
      const char *user = userreader();
      printf("%s", user);
  }
  </code></pre>
  
  <p>GDB: </p>
  
  <blockquote>
    <p>Program received signal SIGSEGV, Segmentation fault. 0xb7e63496 in
    free () from /lib/i386-linux-gnu/libc.so.6</p>
  </blockquote>