summaryrefslogtreecommitdiff
path: root/src/bin/edje
diff options
context:
space:
mode:
authorThiep Ha <thiep.ha@samsung.com>2014-12-18 09:05:50 +0900
committerChunEon Park <hermet@hermet.pe.kr>2014-12-18 09:05:50 +0900
commit6d0b834a76c3301bf4c4b29752f902dbe8a8525e (patch)
tree104d59da7e4935b6758f8f78b905435d0f477823 /src/bin/edje
parent63abe9b00cc02940361372cb0881d3f7fbb682f2 (diff)
edje: free allocated memory in epp
Summary: fname variable's memory is allocated but not freed. Reviewers: cedric, seoz, woohyun, Hermet Reviewed By: Hermet Differential Revision: https://phab.enlightenment.org/D1785
Diffstat (limited to 'src/bin/edje')
-rw-r--r--src/bin/edje/epp/cpplib.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/bin/edje/epp/cpplib.c b/src/bin/edje/epp/cpplib.c
index 632ffe2237..3cfc3a8e2f 100644
--- a/src/bin/edje/epp/cpplib.c
+++ b/src/bin/edje/epp/cpplib.c
@@ -3325,13 +3325,19 @@ do_include(cpp_reader * pfile, struct directive *keyword,
3325 strncpy(fname, (const char *)fbeg, flen); 3325 strncpy(fname, (const char *)fbeg, flen);
3326 fname[flen] = 0; 3326 fname[flen] = 0;
3327 if (redundant_include_p(pfile, fname)) 3327 if (redundant_include_p(pfile, fname))
3328 return 0; 3328 {
3329 free(fname);
3330 return 0;
3331 }
3329 if (importing) 3332 if (importing)
3330 f = lookup_import(pfile, fname, NULL); 3333 f = lookup_import(pfile, fname, NULL);
3331 else 3334 else
3332 f = open_include_file(pfile, fname, NULL); 3335 f = open_include_file(pfile, fname, NULL);
3333 if (f == -2) 3336 if (f == -2)
3334 return 0; /* Already included this file */ 3337 {
3338 free(fname);
3339 return 0; /* Already included this file */
3340 }
3335 } 3341 }
3336 else 3342 else
3337 { 3343 {
@@ -3380,13 +3386,19 @@ do_include(cpp_reader * pfile, struct directive *keyword,
3380 * of redundant include files: #import, #pragma once, and 3386 * of redundant include files: #import, #pragma once, and
3381 * redundant_include_p. It would be nice if they were unified. */ 3387 * redundant_include_p. It would be nice if they were unified. */
3382 if (redundant_include_p(pfile, fname)) 3388 if (redundant_include_p(pfile, fname))
3383 return 0; 3389 {
3390 free(fname);
3391 return 0;
3392 }
3384 if (importing) 3393 if (importing)
3385 f = lookup_import(pfile, fname, searchptr); 3394 f = lookup_import(pfile, fname, searchptr);
3386 else 3395 else
3387 f = open_include_file(pfile, fname, searchptr); 3396 f = open_include_file(pfile, fname, searchptr);
3388 if (f == -2) 3397 if (f == -2)
3389 return 0; /* Already included this file */ 3398 {
3399 free(fname);
3400 return 0; /* Already included this file */
3401 }
3390#ifdef EACCES 3402#ifdef EACCES
3391 else if (f == -1 && errno == EACCES) 3403 else if (f == -1 && errno == EACCES)
3392 cpp_warning(pfile, "Header file %s exists, but is not readable", 3404 cpp_warning(pfile, "Header file %s exists, but is not readable",
@@ -3467,6 +3479,7 @@ do_include(cpp_reader * pfile, struct directive *keyword,
3467 if (!strcmp(ptr->fname, fname)) 3479 if (!strcmp(ptr->fname, fname))
3468 { 3480 {
3469 close(f); 3481 close(f);
3482 free(fname);
3470 return 0; /* This file was once'd. */ 3483 return 0; /* This file was once'd. */
3471 } 3484 }
3472 } 3485 }
@@ -3524,6 +3537,7 @@ do_include(cpp_reader * pfile, struct directive *keyword,
3524 if (angle_brackets) 3537 if (angle_brackets)
3525 pfile->system_include_depth--; 3538 pfile->system_include_depth--;
3526 } 3539 }
3540 free(fname);
3527 return 0; 3541 return 0;
3528} 3542}
3529 3543