mojoshader_preprocessor.c
changeset 560 225d579ae929
parent 559 d34ac77da171
child 561 0d2535cc5ac3
equal deleted inserted replaced
559:d34ac77da171 560:225d579ae929
   196     IncludeState *state = (IncludeState *) Malloc(ctx, sizeof (IncludeState));
   196     IncludeState *state = (IncludeState *) Malloc(ctx, sizeof (IncludeState));
   197     if (state == NULL)
   197     if (state == NULL)
   198         return 0;
   198         return 0;
   199     memset(state, '\0', sizeof (IncludeState));
   199     memset(state, '\0', sizeof (IncludeState));
   200 
   200 
   201     state->filename = StrDup(ctx, fname);
   201     if (fname != NULL)
   202     if (state->filename == NULL)
   202     {
   203     {
   203         state->filename = StrDup(ctx, fname);
   204         Free(ctx, state);
   204         if (state->filename == NULL)
   205         return 0;
   205         {
       
   206             Free(ctx, state);
       
   207             return 0;
       
   208         } // if
   206     } // if
   209     } // if
   207 
   210 
   208     state->included = included;
   211     state->included = included;
   209     state->source_base = source;
   212     state->source_base = source;
   210     state->source = source;
   213     state->source = source;