title: Insert db fails
body: <pre><code>void InsertEmployeeRec(PGconn *conn, char * fullname)
  {
    // Append the SQL statment
    std::string sSQL;
    sSQL.append("INSERT INTO Worker VALUES ('");
    sSQL.append(fullname);
    sSQL.append("')");
  
    // Execute with sql statement
    PGresult *res = PQexec(conn, sSQL.c_str());
  
      if (PQresultStatus(res) != PGRES_COMMAND_OK)
      {
          printf("Insert employee record failed");
          PQclear(res);
          CloseConn(conn);
      }
  
    printf("Insert employee record - OK\n");
  
    // Clear result
    PQclear(res);
  }
  </code></pre>
  
  <p>this is my function to insert db and call it like that</p>
  
  <pre><code>InsertEmployeeRec(conn,"n");
  </code></pre>
  
  <p>At the end, i get the error:</p>
  
  <p>glibc detected <strong>* /home/mert/workspace1/Project/Debug/Project: double free or corruption (!prev): 0x0000000001df4050 *</strong></p>
  
  <p>What might be the problem?</p>