<commit_before>#include <stdlib.h>
#include "midi.h"
#include "timer.h"
#include "clock.h"
#include "message.h"

struct MIDITimer {
  int refs;
  struct MIDITimerDelegate * delegate;
  MIDILongValue song_position;
  MIDILongValue beats_per_minute;
  MIDITimestamp last_timestamp;
  MIDITimestamp clocks[4];
};

struct MIDITimer * MIDITimerCreate( struct MIDITimerDelegate * delegate ) {
  struct MIDITimer * timer = malloc( sizeof( struct MIDITimer ) );
  timer->refs = 1;
  timer->delegate         = delegate;
  timer->song_position    = 0;
  timer->beats_per_minute = 120;
  timer->last_timestamp   = -1;
  timer->clocks[0]        = -1;
  timer->clocks[1]        = -1;
  timer->clocks[2]        = -1;
  timer->clocks[3]        = -1;
  return timer;
}<commit_msg>Add missing Null check<commit_after>#include <stdlib.h>
#include "midi.h"
#include "timer.h"
#include "clock.h"
#include "message.h"

struct MIDITimer {
  int refs;
  struct MIDITimerDelegate * delegate;
  MIDILongValue song_position;
  MIDILongValue beats_per_minute;
  MIDITimestamp last_timestamp;
  MIDITimestamp clocks[4];
};

struct MIDITimer * MIDITimerCreate( struct MIDITimerDelegate * delegate ) {
  struct MIDITimer * timer = malloc( sizeof( struct MIDITimer ) );
  if( timer == NULL ) return NULL;
  timer->refs = 1;
  timer->delegate         = delegate;
  timer->song_position    = 0;
  timer->beats_per_minute = 120;
  timer->last_timestamp   = -1;
  timer->clocks[0]        = -1;
  timer->clocks[1]        = -1;
  timer->clocks[2]        = -1;
  timer->clocks[3]        = -1;
  return timer;
}
{'fraction_non_alphanumeric': 0.12786259541984732, 'fraction_numerical': 0.019083969465648856, 'mean_word_length': 3.3573407202216066, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3041480', 'n_tokens_mistral': 601, 'n_tokens_neox': 563, 'n_words': 124}