Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: src/ports/SkOSFile_stdio.cpp

Issue 2354963002: Fix a memory leak reported by clang static analyzer. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkOSFile.h" 8 #include "SkOSFile.h"
9 #include "SkTypes.h" 9 #include "SkTypes.h"
10 10
(...skipping 13 matching lines...) Expand all
24 #ifdef SK_BUILD_FOR_IOS 24 #ifdef SK_BUILD_FOR_IOS
25 #import <CoreFoundation/CoreFoundation.h> 25 #import <CoreFoundation/CoreFoundation.h>
26 26
27 static FILE* ios_open_from_bundle(const char path[], const char* perm) { 27 static FILE* ios_open_from_bundle(const char path[], const char* perm) {
28 // Get a reference to the main bundle 28 // Get a reference to the main bundle
29 CFBundleRef mainBundle = CFBundleGetMainBundle(); 29 CFBundleRef mainBundle = CFBundleGetMainBundle();
30 30
31 // Get a reference to the file's URL 31 // Get a reference to the file's URL
32 CFStringRef pathRef = CFStringCreateWithCString(NULL, path, kCFStringEncodin gUTF8); 32 CFStringRef pathRef = CFStringCreateWithCString(NULL, path, kCFStringEncodin gUTF8);
33 CFURLRef imageURL = CFBundleCopyResourceURL(mainBundle, pathRef, NULL, NULL) ; 33 CFURLRef imageURL = CFBundleCopyResourceURL(mainBundle, pathRef, NULL, NULL) ;
34 CFRelease(pathRef);
34 if (!imageURL) { 35 if (!imageURL) {
35 return nullptr; 36 return nullptr;
36 } 37 }
37 38
38 // Convert the URL reference into a string reference 39 // Convert the URL reference into a string reference
39 CFStringRef imagePath = CFURLCopyFileSystemPath(imageURL, kCFURLPOSIXPathSty le); 40 CFStringRef imagePath = CFURLCopyFileSystemPath(imageURL, kCFURLPOSIXPathSty le);
40 41
41 // Get the system encoding method 42 // Get the system encoding method
42 CFStringEncoding encodingMethod = CFStringGetSystemEncoding(); 43 CFStringEncoding encodingMethod = CFStringGetSystemEncoding();
43 44
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 #else 204 #else
204 retval = mkdir(path, 0777); 205 retval = mkdir(path, 0777);
205 #endif 206 #endif
206 if (0 == retval) { 207 if (0 == retval) {
207 return true; 208 return true;
208 } else { 209 } else {
209 fprintf(stderr, "sk_mkdir: error %d creating dir '%s'\n", errno, path); 210 fprintf(stderr, "sk_mkdir: error %d creating dir '%s'\n", errno, path);
210 return false; 211 return false;
211 } 212 }
212 } 213 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698