Mercurial > hg > sidinfo
diff sidlib.c @ 236:609bfc1bd628
Change sidlib_sldb_new() API to int sidlib_sldb_new(SIDLibSLDB **pdbh).
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 04 Jan 2020 13:18:55 +0200 |
parents | 03b6f8604a7f |
children | d28f3d537284 |
line wrap: on
line diff
--- a/sidlib.c Sat Jan 04 13:11:56 2020 +0200 +++ b/sidlib.c Sat Jan 04 13:18:55 2020 +0200 @@ -421,9 +421,13 @@ } -SIDLibSLDB * sidlib_sldb_new(void) +int sidlib_sldb_new(SIDLibSLDB **pdbh) { - return (SIDLibSLDB *) th_malloc0(sizeof(SIDLibSLDB)); + SIDLibSLDB *dbh; + if ((dbh = *pdbh = (SIDLibSLDB *) th_malloc0(sizeof(SIDLibSLDB))) == NULL) + return THERR_MALLOC; + + return THERR_OK; }