Changeset 4975:1b8be0a0ba5f in roaraudio for libroar
- Timestamp:
- 05/16/11 15:16:33 (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- libroar
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/vio_cmd.c
r4956 r4975 62 62 63 63 if ( reader != NULL ) 64 state->reader.cmd = strdup(reader);64 state->reader.cmd = roar_mm_strdup(reader); 65 65 66 66 state->writer.pid = -1; … … 69 69 70 70 if ( writer != NULL ) 71 state->writer.cmd = strdup(writer);71 state->writer.cmd = roar_mm_strdup(writer); 72 72 73 73 // init state … … 125 125 126 126 if ( state->reader.cmd != NULL ) 127 free(state->reader.cmd);127 roar_mm_free(state->reader.cmd); 128 128 129 129 if ( state->writer.cmd != NULL ) 130 free(state->writer.cmd);130 roar_mm_free(state->writer.cmd); 131 131 132 132 roar_vio_close(state->next); … … 241 241 state->child.out = -1; 242 242 243 state->child.cmd = strdup(command);243 state->child.cmd = roar_mm_strdup(command); 244 244 245 245 // init state … … 281 281 282 282 if ( state->child.cmd != NULL ) 283 free(state->child.cmd);283 roar_mm_free(state->child.cmd); 284 284 285 285 roar_mm_free(state); -
libroar/vio_dstr.c
r4964 r4975 770 770 return -1; 771 771 772 if ( roar_vio_open_stack (calls) == -1 )772 if ( roar_vio_open_stack2(calls, NULL) == -1 ) 773 773 return -1; 774 774 … … 776 776 777 777 if ( (def = chain->def) != NULL ) { 778 if ( (tc = malloc(sizeof(struct roar_vio_calls))) == NULL ) {778 if ( (tc = roar_mm_malloc(sizeof(struct roar_vio_calls))) == NULL ) { 779 779 _ret(-1); 780 780 } 781 781 782 782 if ( roar_vio_clear_calls(tc) == -1 ) { 783 free(tc);783 roar_mm_free(tc); 784 784 _ret(-1); 785 785 } … … 809 809 810 810 if ( c->need_vio ) { 811 if ( (tc = malloc(sizeof(struct roar_vio_calls))) == NULL ) {811 if ( (tc = roar_mm_malloc(sizeof(struct roar_vio_calls))) == NULL ) { 812 812 _ret(-1); 813 813 } 814 814 815 815 if ( roar_vio_clear_calls(tc) == -1 ) { 816 free(tc);816 roar_mm_free(tc); 817 817 _ret(-1); 818 818 } -
libroar/vio_stack.c
r4708 r4975 37 37 38 38 int roar_vio_open_stack (struct roar_vio_calls * calls) { 39 return roar_vio_open_stack2(calls, free); 40 } 41 42 int roar_vio_open_stack2 (struct roar_vio_calls * calls, void (*func)(void*)) { 39 43 struct roar_vio_stack * self; 40 44 41 if ( calls == NULL ) 42 return -1; 45 if ( calls == NULL ) { 46 roar_err_set(ROAR_ERROR_FAULT); 47 return -1; 48 } 49 50 if ( func == NULL ) 51 func = roar_mm_free_retvoid; 43 52 44 53 if ( (self = roar_mm_malloc(sizeof(struct roar_vio_stack))) == NULL ) … … 47 56 memset(self, 0, sizeof(struct roar_vio_stack)); 48 57 memset(calls, 0, sizeof(struct roar_vio_calls)); 58 59 self->free = func; 49 60 50 61 calls->inst = self; … … 63 74 struct roar_vio_stack * self; 64 75 65 if ( calls == NULL || vio == NULL ) 66 return -1; 67 68 if ( (self = calls->inst) == NULL ) 69 return -1; 76 if ( calls == NULL || vio == NULL ) { 77 roar_err_set(ROAR_ERROR_FAULT); 78 return -1; 79 } 80 81 if ( (self = calls->inst) == NULL ) { 82 roar_err_set(ROAR_ERROR_FAULT); 83 return -1; 84 } 70 85 71 86 if ( self->next == ROAR_VIO_STACK_MAX ) … … 81 96 int i; 82 97 83 if ( vio == NULL ) 84 return -1; 98 if ( vio == NULL ) { 99 roar_err_set(ROAR_ERROR_FAULT); 100 return -1; 101 } 85 102 86 103 if ( (self = vio->inst) == NULL ) … … 92 109 93 110 for (i = 0; i < self->next; i++) 94 free(self->calls[i]);111 self->free(self->calls[i]); 95 112 } 96 113
Note: See TracChangeset
for help on using the changeset viewer.