Soultaker: Bedankt voor je hulp en alle moeite die je hebt gedaan!
Ik heb gekeken welke invloed het weghalen van dingen had, en dat gaf bij mij een andere uitwerking als bij Soultaker zijn onderzoek.
Al snel kwam ik er achter dat de fout heel ergens anders ligt, namelijk bij mysql_init:
code:
1
| omsclient->mysql=mysql_init(omsclient->mysql); |
Uit de mysql manual:
24.1.3.122 mysql_init()
MYSQL *mysql_init(MYSQL *mysql)
24.1.3.123 Description
Allocates or initializes a MYSQL object suitable for mysql_real_connect(). If mysql is a NULL pointer, the function allocates, initializes, and returns a new object. Otherwise the object is initialized and the address of the object is returned. If mysql_init() allocates a new object, it will be freed when mysql_close() is called to close the connection.
24.1.3.124 Return Values
An initialized MYSQL* handle. NULL if there was insufficient memory to allocate a new object.
24.1.3.125 Errors
In case of insufficient memory, NULL is returned.
Het vetgedrukte stuk heb ik niet goed gelezen

Want hieruit is te concluderen dat mijn regeltje code volstrekt onjuist is. Het valt trouwens niet goed te zien in de code maar in mijn structure is mysql van het type *MYSQL, verder niet geinitialiseerd of allocated. En dat gaat natuurlijk mis, aangezien mysql_init er al vanuit gaat dat er al geheugenruimte is gereserveerd voor MYSQL.
code:
1
| omsclient->mysql=mysql_init(NULL); |
En het gaat perfect!
DOM DOM DOM
Maar goed weer wat geleerd