diff options
| -rw-r--r-- | apps/plugins/midi/midifile.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/apps/plugins/midi/midifile.c b/apps/plugins/midi/midifile.c index 1fa648f..7b59ed2 100644 --- a/apps/plugins/midi/midifile.c +++ b/apps/plugins/midi/midifile.c @@ -24,6 +24,8 @@ extern struct plugin_api * rb; struct Track * readTrack(int file); int readID(int file); +struct MIDIfile midi_file IBSS_ATTR; + struct MIDIfile * loadFile(char * filename) { struct MIDIfile * mfload; @@ -35,14 +37,7 @@ struct MIDIfile * loadFile(char * filename) return NULL; } - mfload = (struct MIDIfile*)malloc(sizeof(struct MIDIfile)); - - if(mfload==NULL) - { - rb->close(file); - printf("Could not allocate memory for MIDIfile struct"); - return NULL; - } + mfload = &midi_file; rb->memset(mfload, 0, sizeof(struct MIDIfile)); |