1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +03:00

Fixed some memory bugs that somehow reappeared.

Also fixed a new Coverity report.
This commit is contained in:
Michael Meskes
2006-08-09 09:08:32 +00:00
parent 7c9e2c75da
commit e6e61afe16
9 changed files with 499 additions and 482 deletions

View File

@ -1,4 +1,4 @@
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.57 2006/08/08 15:30:39 meskes Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.58 2006/08/09 09:08:31 meskes Exp $ */
/*
* The aim is to get a simpler inteface to the database routines.
@ -1018,6 +1018,7 @@ ECPGstore_input(const int lineno, const bool force_indicator, const struct varia
strcpy(mallocedval + strlen(mallocedval), "date ");
strncpy(mallocedval + strlen(mallocedval), str, slen + 1);
strcpy(mallocedval + strlen(mallocedval), ",");
ECPGfree(str);
}
strcpy(mallocedval + strlen(mallocedval) - 1, "]");
}
@ -1037,11 +1038,11 @@ ECPGstore_input(const int lineno, const bool force_indicator, const struct varia
strcpy(mallocedval, "date ");
/* also copy trailing '\0' */
strncpy(mallocedval + strlen(mallocedval), str, slen + 1);
ECPGfree(str);
}
*tobeinserted_p = mallocedval;
*malloced_p = true;
ECPGfree(str);
}
break;
@ -1072,6 +1073,7 @@ ECPGstore_input(const int lineno, const bool force_indicator, const struct varia
strcpy(mallocedval + strlen(mallocedval), "timestamp ");
strncpy(mallocedval + strlen(mallocedval), str, slen + 1);
strcpy(mallocedval + strlen(mallocedval), ",");
ECPGfree(str);
}
strcpy(mallocedval + strlen(mallocedval) - 1, "]");
}
@ -1091,11 +1093,11 @@ ECPGstore_input(const int lineno, const bool force_indicator, const struct varia
strcpy(mallocedval, "timestamp ");
/* also copy trailing '\0' */
strncpy(mallocedval + strlen(mallocedval), str, slen + 1);
ECPGfree(str);
}
*tobeinserted_p = mallocedval;
*malloced_p = true;
ECPGfree(str);
}
break;