Changeset 5901:64d1f534671b in roaraudio
- Timestamp:
- 04/14/13 16:59:26 (11 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/memmgr.h
r5823 r5901 74 74 // this should only be used in case a function pointer of this type is required. 75 75 void roar_mm_free_retvoid(void *ptr); 76 77 // dummy function doing the same as roar_mm_free() but does not return any error 78 // or alter global error states. 79 void roar_mm_free_noerror(void *ptr); 76 80 77 81 // memory locking: -
libroar/basic.c
r5897 r5901 152 152 roar_err_update(); 153 153 ROAR_ERR("_start_server_win32(server='%s', ...): Can not start server: %s: %s", server, daemonimage, roar_errorstring); 154 err = roar_error; 155 roar_mm_free(daemonimage); 156 roar_error = err; 154 roar_mm_free_noerror(daemonimage); 157 155 return -1; 158 156 } … … 201 199 if ( socketpair(AF_UNIX, SOCK_STREAM, 0, socks) == -1 ) { 202 200 roar_err_from_errno(); 203 err = roar_error; 204 roar_mm_free(daemonimage); 205 roar_error = err; 201 roar_mm_free_noerror(daemonimage); 206 202 return -1; 207 203 } -
libroar/buffer.c
r5823 r5901 111 111 112 112 if ( roar_buffer_new_no_ma(buf, len, bufdata) == -1 ) { 113 err = roar_error; 114 roar_mm_free(bufdata); 115 roar_err_set(err); 113 roar_mm_free_noerror(bufdata); 116 114 return -1; 117 115 } -
libroar/cdrom.c
r5896 r5901 54 54 int fh[2]; 55 55 char * bin_cdparanoia = NULL, * dev_stdin = NULL; 56 int err;57 56 58 57 ROAR_DBG("roar_cdrom_run_cdparanoia(cdrom=%i, data=%i, track=%i, pos='%s') = ?", cdrom, data, track, pos); … … 98 97 dev_stdin = roar_libroar_get_path("dev-stdin", 0, NULL, NULL); 99 98 if ( dev_stdin == NULL ) { 100 err = roar_error; 101 roar_mm_free(bin_cdparanoia); 102 roar_error = err; 99 roar_mm_free_noerror(bin_cdparanoia); 103 100 return -1; 104 101 } -
libroar/libroar.c
r5837 r5901 179 179 pid_t roar_fork(const struct roar_libroar_forkapi * api) { 180 180 void * context = NULL; 181 int err;182 181 pid_t ret; 183 182 … … 195 194 api->failed(&context, api->userdata); 196 195 197 if ( context != NULL ) { 198 err = roar_error; 199 roar_mm_free(context); 200 roar_error = err; 201 } 196 if ( context != NULL ) 197 roar_mm_free_noerror(context); 202 198 return (pid_t)-1; 203 199 } … … 208 204 api->failed(&context, api->userdata); 209 205 210 if ( context != NULL ) { 211 err = roar_error; 212 roar_mm_free(context); 213 roar_error = err; 214 } 206 if ( context != NULL ) 207 roar_mm_free_noerror(context); 215 208 return (pid_t)-1; 216 209 } … … 224 217 } 225 218 226 if ( context != NULL ) { 227 err = roar_error; 228 roar_mm_free(context); 229 roar_error = err; 230 } 219 if ( context != NULL ) 220 roar_mm_free_noerror(context); 231 221 232 222 return ret; -
libroar/memmgr.c
r5823 r5901 267 267 } 268 268 269 void roar_mm_free_noerror(void *ptr) { 270 struct roar_error_state state; 271 272 if ( ptr == NULL ) 273 return; 274 275 roar_err_store(&state); 276 roar_mm_free(ptr); 277 roar_err_restore(&state); 278 } 279 269 280 #if defined(ROAR_USE_MEMMGR) || !defined(ROAR_HAVE_STRDUP) 270 281 char * roar_mm_strdup(const char *s) { -
libroar/roardl.c
r5836 r5901 97 97 ret->args_store = roar_mm_strdup(args); 98 98 if ( ret->args_store == NULL ) { 99 err = roar_error; 100 roar_mm_free(ret); 101 roar_error = err; 99 roar_mm_free_noerror(ret); 102 100 return NULL; 103 101 } -
libroar/vio_cmd.c
r5896 r5901 631 631 int pwpipe[2]; 632 632 int ret; 633 int err;634 633 635 634 /* … … 655 654 if ( pw != NULL ) { 656 655 if ( pipe(pwpipe) == -1 ) { 657 err = roar_error; 658 roar_mm_free(bin_gpg); 659 roar_error = err; 656 roar_mm_free_noerror(bin_gpg); 660 657 return -1; 661 658 } -
libroar/vio_stream.c
r5896 r5901 116 116 117 117 if ( roar_simple_connect(con, server, name) == -1 ) { 118 err = roar_error; 119 roar_mm_free(con); 120 roar_error = err; 118 roar_mm_free_noerror(con); 121 119 return -1; 122 120 } -
libroar/vio_zlib.c
r5823 r5901 516 516 int roar_vio_open_zlib(struct roar_vio_calls * calls, struct roar_vio_calls * dst, int level, int gzip) { 517 517 struct roar_vio_gzip * self; 518 int err;519 518 520 519 ROAR_DBG("roar_vio_open_zlib(calls=%p, dst=%p, level=%i, gzip=%i) = ?", calls, dst, level, gzip); … … 528 527 529 528 if ( _init(self, dst, level, gzip) == -1 ) { 530 err = roar_error; 531 roar_mm_free(self); 532 roar_err_set(err); 529 roar_mm_free_noerror(self); 533 530 ROAR_DBG("roar_vio_open_zlib(calls=%p, dst=%p, level=%i, gzip=%i) = -1 // error=%s", calls, dst, level, gzip, roar_error2str(err)); 534 531 return -1;
Note: See TracChangeset
for help on using the changeset viewer.